cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <>
Subject Re: OSGI service dynamic discovery using zookeeper
Date Thu, 11 Oct 2012 13:03:44 GMT
It is easy to let the zookeeper know when you publish the service.
But you client need more work to know the real service address by looking up the address from
the zookeeper.

CXF client has the failover feature[1] could help you do this kind of work, you just need
to configure the endpoint address which you want to use.
With the fabric-cxf[2] component you can do the same thing by leverage the zookeeper which
just implement the feature you need.

Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: |
Blog: ( (English)
 ( (Chinese)
Twitter: willemjiang 
Weibo: willemjiang

On Thursday, October 11, 2012 at 11:09 AM, Roger wrote:

> Hi everyone,
> Recently, I have just started exploring on the OSGI service dynamic
> discovery using the zookeeper.
> Background info
> ------------------
> I am using the eclipse osgi jars to start the bundles.
> I followed the instruction from the apache website to configure the
> zookeeper.
> Currently, I am able to publish my OSGI services to the zookeeper/osgi
> folder & also able to connect to the zookeeper using the client & retrieve
> the published service information. When I published a new service, the
> service will be reflected in the zookeeper.
> Testing environment
> ----------------------
> I have two machines.
> I am running the same greeter service in two separate machines
> (connected in the same network).
> At the same time, I am running the greeter client program in one of the
> machines.
> I have also published both the services in the zookeeper (after placing
> the zookeeper.cfg in the load folder).
> Verify my concept
> --------------------
> I am thinking if I stop the service which runs in the same machine as
> the greeter client program, the greeter client should be able to track the
> other remote service running in the other machine (Is my concept right?). 
> However, when I stop the service (which runs in the same machine as the
> greeter client program), the servicetracker is not able to track the remote
> service. The number of tracked services is 0. 
> My questions are:
> 1) Are there any other settings which needs to be done for the client to
> discover the published services in the zookeeper? Must I tell the client
> where is the zookeeper or this is done by the single-bundle?
> 2) It seems like the client is not interacting with the zookeeper to get
> the published services information. Must I do anything to the client to
> retrieve the info?
> 3) Why cant the client switch to the remote service automatically?
> Thanks a lot in advance.
> Roger
> --
> View this message in context:
> Sent from the cxf-dev mailing list archive at (

View raw message