I’m new to the BloomReach platform and I’m wondering if some kind individual might be able to provide me with direction on best practices for setting environment-specific properties that can then be accessed by, say, Spring beans.
This is something that can come up if we need to integrate with a third-party service provider to specify some sort of property (eg. “client.id”) whose value might differ between the DEV and STAGING environments, for example.
To illustrate more clearly, in a shared development server (eg. “DEV”), I might need to specify:
client.id=devserverclientid
And similarly in a STAGING/QA environment, I might need to use the same property name, but with a different value like so:
client.id=stagingserverclientid
Is there a standard approach to setting such environment-specific properties in BloomReach?
One approach that came to my mind was to try to add a new String property to the “/hst:hst/hst:hosts/dev-localhost” virtual host group in the CMS Console, and then define other virtual host groups for other environments (QA, UAT, PROD, whatever). However, I quickly discovered that I cannot just add any arbitrary string property to an hst:virtualhostgroup.
Any help in the matter would be very gratefully appreciated!
Hi,
You may want to consider this [1], specially when you are developing HST components.
One of the suggested way is to drop a hst.properties file in your catalina /conf folder: once loaded, those properties can be used almost everywhere in your site application.
For each environment you can have different values in those properties files.
I’m not sure if the above approach is the most elegant way to do this in BloomReach, but it appears to work just fine. Note that, when I placed an hst.properties file in the /conf folder without taking steps such as those described above, I was unable to access properties values with Spring annotations such as “@Value”. But that’s fine because this approach appears to work well.