I've written a OSGi service factory. want to define configuration for each instances of the service in Karaf. Below are the questions I've. 1. Where to define bundle specific .cfg in Karaf? I've seen answers that it should be in /etc or can be implemented via fileinstall. Still couldn't get a clear step by step procedure from implementation perspective. Need a step by step solution for the same. 2. If we've different configuration for every other environment for each service, how to maintain the same. Is there any ideal approach for the same?
Asked
Active
Viewed 106 times
0
-
Thanks @NeilBartlett for your response. I've created servicefactory class. Also, I created a config file
- – user4386842 Sep 01 '16 at 06:42under the same project. I've defined the config file as a karaf feature definition. How to deploy those config file automatically into /etc folder ? Could you please share any working example for the same. -
A `ServiceFactory`?? That sounds wrong. They are not used for Configuration. – Neil Bartlett Sep 01 '16 at 06:43
-
Sorry, I meant ManagedServiceFactory. For the factory, I created couple of config files. Am not sure how to deploy those into etc folder? – user4386842 Sep 01 '16 at 06:47
-
Are you asking how to copy some files into a folder? – Neil Bartlett Sep 01 '16 at 06:51
-
I want to deploy all those configuration files automatically into karaf etc folder. Don't want to copy those files manually into etc folder. – user4386842 Sep 01 '16 at 06:54
-
So maybe you need a cron job? – Neil Bartlett Sep 01 '16 at 06:56
-
Can't we achieve it via maven & karaf feature definition? – user4386842 Sep 01 '16 at 07:03
-
Achieve what? You've said almost nothing about what you actually want to do. – Neil Bartlett Sep 01 '16 at 07:05
-
I want to deploy .cfg files of those managedservicefactory via maven & karaf feature definition into karaf etc folder. Is there a way to do the same? – user4386842 Sep 01 '16 at 07:08
-
The same what? I don't understand. You want to copy some files but you prefer to use a maven plugin than the `cp` command? – Neil Bartlett Sep 01 '16 at 07:35