spring - Spring boot @Configurationproperties 大 yaml 文件 - 嵌套映射
问题描述
我正在运行一个 Spring Boot 应用程序并有一个大型 application.yml 文件,该文件具有复杂结构(嵌套映射)的属性,我正在尝试使用 @Configurationproperties 进行绑定。我可以在文件较小时绑定它,但随着文件大小的增长,加载需要很长时间并增加启动时间。Yaml 的结构:
a:
b:
- map1:
'3000':
map2:
'3000': 'true'
'3010': 'true'
'4000': 'true'
'4300': 'true'
'3300': 'true'
'3400': 'true'
'3700': 'true'
'4600': 'true'
'4700': 'true'
'3010':
map2:
'3000': 'true'
'3010': 'true'
'4000': 'true'
'4300': 'true'
'3300': 'true'
'3400': 'true'
'3700': 'true'
'4600': 'true'
'4700': 'true'
我想减少加载时间,想知道是否有办法延迟加载嵌套地图。即仅在请求某些内容时才加载地图?
解决方案
推荐阅读
- javascript - 从代码中设置的 env 变量在 node.js 的导入模块中不可用
- node.js - 在我的测试用例中从外部 API 获取 Firebase 令牌
- java - 如何在其他服务实现中从 SpringSecurity 接收经过身份验证的用户,而不是匿名用户。(Spring Security+JWT)
- c# - C# 根据 x86 或 x64 切换依赖项
- html - Svelte:以可重用的方式关联标签和输入
- google-apps-script - onFormSubmit() 在 Google 表单中不起作用?
- python - Python to c return free(): 无效指针
- javascript - 如何使用 Matter.js 和 p5.js 将文本放在矩形中
- angular - 模态中的元素不响应角度中的单击事件
- python - pandas:将奇怪的字典类型的数据更改为数据框