Skip to content

Instantly share code, notes, and snippets.

@mgmgpyaesonewin
Created June 27, 2022 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgmgpyaesonewin/41c97795f0024c34e96988cf53ef8bbc to your computer and use it in GitHub Desktop.
Save mgmgpyaesonewin/41c97795f0024c34e96988cf53ef8bbc to your computer and use it in GitHub Desktop.
Reading Config Map in spring boot
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "integrated-client")
public class AgentIdMapConfig {
private Map<String, Long> agentIdMap;
public Map<String, Long> getAgentIdMap() {
return agentIdMap;
}
public void setAgentIdMap(Map<String, Long> agentIdMap) {
this.agentIdMap = agentIdMap;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment