1 Reply Latest reply on Jul 17, 2012 6:42 AM by Ioannis Canellos

    Fabric for bundle config?

    mikek753_michael.korolyov Newbie

      hi,

       

      Is there a way to configure blueprint bundle via Fabric?

      I'd like to have ability to push bundle config properties through Fabric, store it in zk.

      When my bundle starts it should get config props from Fabric / zk.

      When props are changed in zk them my bundle has to reload with updated props.

       

      Can Fabric help for this matter? And how?

      Anything else can configure OSGi bundle from zk?

       

      thanks.

        • 1. Re: Fabric for bundle config?
          Ioannis Canellos Newbie

          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.