Reading Configuration Value in Spring Boot
This is my personal notes for my spring boot leaning journey. Please feel free to discuss.
Wiki topics:
📚 · Books & Reading
Reading Configuration Value in Spring Boot
This is my personal notes for my spring boot leaning journey. Please feel free to discuss.

There is two ways to read configuration in spring boot.
- Reading as Config Map
Configuration will be defined in application.properties file.
[embed]
It will be read with a class. The class can also be used as bean class.
[embed]
Read via as bean
@Autowired
private AgentIdMapConfig agentIdMapConfig;
// To read into vars
Long agentId = agentIdMapConfig.getAgentIdMap().get(client);
- Reading directly as config value
[embed]
메타데이터
- post_id
- 43a74e7ef8ba
- slug
- reading-configuration-value-in-spring-boot-43a74e7ef8ba
- url
- https://medium.com/@pyaesone/reading-configuration-value-in-spring-boot-43a74e7ef8ba
- canonical_url
- https://medium.com/@pyaesone/reading-configuration-value-in-spring-boot-43a74e7ef8ba
- author_url
- https://medium.com/@pyaesone
- status
- ok
- fetched_at
- 2026-07-26 23:00:14