4 Replies Latest reply on Aug 24, 2012 12:27 AM by mcr701

    CXF-DOSGI Distributed discovery

    spandit2

      Hi ,

       

      I was wondering if any one was successful in configuring CXF -DOSGI discovery service and zookeeper . I am using multi bundle version of the CXF and I am not sure how to ensure that the services are being registered in the service registry. I do not see any activity on ZooKeeper or on Jboss . I saw one post by David BossChaert issue # As-942 but do not see any activity on that . 

       

      Is there any configuration I must do . I have added following configuration to standalone.xml

       

       

      <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="eager">

      <configuration pid="org.apache.cxf.dosgi.discovery.zookeeper">

      <property name="zookeeper.host">

      127.0.0.1

      </property>

      <property name="zookeeper.port">

      2181

      </property>

      </configuration>

       

      I would appreciate any insights on configuring service registry and discover service .

       

      Thanks

      Sunil

        • 1. Re: CXF-DOSGI Distributed discovery
          mcr701

          I'm trying to get the same thing running and I made some progress on this, so I thought

          I will share this, even though it is not yet fully functional. I'm running JBoss 7.1.1.Final

           

          For some reason, I had to disable configadmin subsystem. I got some errors on the log file

          complaining about it.

           

          Instead I have now felix configadmin installed (comes with the cxf dosgi) for the zookeeper part,

          I think these are the capabilities I have:

          - org.apache.felix.configadmin

          - org.apache.felix.fileinstall

          - org.apache.zookeeper

          - com.springsource.org.jdom

          - org.apache.cxfdosgi.cxfdosgi-discovery.distributed

          - org.apache.cxfdosgi.cxfdosgi-discovery.zookeeper-server

          - org.apache.cxfdosgi.cxfdosgi-discovery.zookeeper-server-config

           

          After this setup, I got my zookeeper up and running. And I get my component automatically registered

          to zookeeper.

          • 2. Re: CXF-DOSGI Distributed discovery
            mcr701

            By default, zookeeper assigns a random port number to which it listens. In the log file,

            I could see something like "Setting global zookeeper port to xxxxxx".

            By setting this configuration to standalone.xml, I can set the port number to fixed

             

            <system-properties>

               <property name="org.apache.cxf.dosgi.discovery.zookeeper.port" value="2181" />

            </system-properties>

            • 3. Re: CXF-DOSGI Distributed discovery
              mcr701

              On client side, one needs to create an entry in the OSGi Configuration Admin Service with

              PID org.apache.cxf.dosgi.discovery.zookeeper

              and values

              zookeeper.host=localhost

              zookeeper.port=2181

               

              With Apache Karaf(I'm using karaf as a client OSGi framework), this can be accomplished by creating a file $KARAF_ROOT/etc/org.apache.cxf.dosgi.discovery.zookeeper.cfg

              with contents

              zookeeper.host=localhost

              zookeeper.port=2181

               

              What is still missing, is eclipse integration. I'm using bnd tools to launch my application during development but I have no idea

              so far how to tell bnd tools / eclipse configuration above?!?!?!

              • 4. Re: CXF-DOSGI Distributed discovery
                mcr701

                Eclipse integration can be done by utilizing felix fileinstall bundle (comes with the cxf dosgi).

                Create a directory named "load/" in your projects root and place a file named org.apache.cxf.dosgi.discovery.zookeeper.cfg

                with contents

                zookeeper.host=localhost

                zookeeper.port=2181