As per my requirement, I need to read some values from properties file when CQ starts. I'm thinking for a solution where I can update crx-quickstart\conf\sling.properties which will have values depending on my environment and then when CQ will start then it should read value from this properties file and then I can read from OSGI service. Any advice on how to read from sling.properties file?
Another solution that I'm thinking to create OSGI service which will read from some.properties under c:/somefolder/myprop.properties and then I use @Reference.
Please let me know which approach is better.
Solved! Go to Solution.
As someone else was pointing out making these values OSGI service configurations would be a more scalable solution in the long run. You can combine this with the use of run mode specific configurations in the repository in order to do environment specific configurations as well.
So for example you could use the following run modes:
To distinguish between environments. This means adding the appropriate run mode to the start script in on each instance (so instead run mode being author you would make it author,dev for example).
Then you would actually have multiple configuration directories in you repository:
See http://dev.day.com/docs/en/cq/current/deploying/configuring_osgi.html#OSGi Configuration in the Repository for details on this approach.
Views
Replies
Total Likes
As someone else was pointing out making these values OSGI service configurations would be a more scalable solution in the long run. You can combine this with the use of run mode specific configurations in the repository in order to do environment specific configurations as well.
So for example you could use the following run modes:
To distinguish between environments. This means adding the appropriate run mode to the start script in on each instance (so instead run mode being author you would make it author,dev for example).
Then you would actually have multiple configuration directories in you repository:
See http://dev.day.com/docs/en/cq/current/deploying/configuring_osgi.html#OSGi Configuration in the Repository for details on this approach.
Views
Replies
Total Likes
Hi Team,
@nsinghal3 inactiveforumnotifier Amy_Wong Debbie Woojin jwarren Jochem van Dieten
I couldn't open the below URL: http://dev.day.com/docs/en/cq/current/deploying/configuring_osgi.html#OSGi Configuration in the Repository
As per your comment Please for me.
Views
Replies
Total Likes
A short google search (search terms "AEM configure OSGI") show me this as a first hit:
Jörg
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies