Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having many .properties files to choose from - Changing spring loaded config #65

Open
StigLau opened this issue Dec 14, 2016 · 1 comment

Comments

@StigLau
Copy link

StigLau commented Dec 14, 2016

The main problem with Constretto its too damn addictive and works too well... Kudos!
Our secondary problem is a question of best practice:
Can we change the Constretto config / append it, after its initial setup?
We set up Constretto via Spring, and some .properties files are not known until runtime of the app. However, I cannot figure how to accomplish changing the config in either constretto or spring, as the constretto wiring is masked by Spring.
An example is that I will want to run my constretto-configured application against several database tables. The app can be started anew, having all the diff'ing config contained in separate a .properties file per table. However, since the loading of the .configuration files is locked inside a spring.xml config, they cannot be changed.
I don't like the alternatives I've come up with; sym-links for the .properties or feeding ClassPathXmlApplicationContext a spring-xml with the config-du-jour.
What would you recommend?

@StigLau
Copy link
Author

StigLau commented Dec 14, 2016

In short; this is what I'm trying to do:

<constretto:configuration>
  <constretto:stores>
    <constretto:properties-store>
      <constretto:resource location="classpath:myproperties/hardwired.properties"/>
      <constretto:resource location="file:./override.properties"/>
      <constretto:resource location="${config-du-jour}"/>
    </constretto:properties-store>
  </constretto:stores>
</constretto:configuration>

Excerpt from spring config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant