-
1. Re: Fabric for bundle config?
iocanel Jul 17, 2012 6:42 AM (in response to mikek753_michael.korolyov)As posted in the mailing list:
Yes, Fabric can help you on this matter.
In blueprint you can use placeholders that will get resolved using a configuration PID. Any change for that PID in the configuration admin will either update the values of placeholders or even reload the whole blueprint context (thats configurable).
Fabric allows you to manage distributed configuration. So you can specify the configuration as part of the profile, and Fabric will make sure that this configuration will be assigned to all containers running under that profile.
In practice:
In blueprint you can use property placeholders that will draw values from "yet.another.pid" like this:
<property name="servicePort" value="$"/>
</bean>
Now assuming that this blueprint runs on containers that have assinged the "myprofile", you can change the configuration of "yet.another.pid" as follows:
fabric:profile-edit --pid yet.another.pid/port=9091 myprofile
This command will initally store the new configuration port in zookeeper, than fabric will apply that confgiuration to all containers running the "myprofile" profile. Blueprint will detect the change and will reload the whole context. If you just want to update the values without reloading the whole context you can use update-strategy="update".
I hope this helps.