I have a properties file like this:
my.properties file:
app.One.id=1
app.One.val=60
app.Two.id=5
app.Two.val=75
And I read these values into a
I did not find an ideal way to solve this issue to have dynamic map property read into spring configuration info. Using DB was also not an option for us. This is what I found to be the best alternative for this:
Use a standard format for map key/value pair in the properties file eg: key1 | val1, key2 | val2, key3 | val3, ..., keyn | valn
Read this to a String property or List property in configuration bean like here: Use String to List
Let injected java class split the items into map in setter.
I'm going to mark this as answer. If anyone else has better ways to do this, comment it out and I will change it to answer.