cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shulok, Thomas" <>
Subject RE: Default endpoint via Zookeeper (D-OSGi) (repost to get its own thread, sorry all)
Date Wed, 12 Aug 2009 00:41:44 GMT
One bug leads to another... :-)

Your fix puts the correct endpoint location into the Zookeeper node.  Works great, thanks!

If I don't specify in the service decorator, I would expect it to
default to http://localhost:9000/fully/qualified/ClassName as described in the reference guide
( under service provider properties.
 The default would then get transmorgrified into the actual IP of localhost just like the
endpoint and inserted into the node.  Unfortunately, if I don't specify,
it doesn't show up in the Zookeeper node at all, which means the remote client thinks the
web service address is localhost (i.e. bad).

Any hope/plan to incorporate the default behavior with the Zookeeper integration?


-----Original Message-----
From: David Bosschaert [] 
Sent: Monday, August 10, 2009 6:49 AM
Subject: Re: Default endpoint via Zookeeper (D-OSGi) (repost to get its own thread, sorry

Hi Thomas,

Just to let you know I've just committed a fix for this to trunk (1.1-SNAPSHOT). The builds
should publish a new snapshot of this tonight.

With this fix you can set the property to a localhost value, like
  props.put("", "http://localhost:9100/display");

Once it's pushed into the zookeeper server, the localhost and URLs are changed to contain the real IP address of the host, like this:

Hope this works for you too.
zkCli> get 
zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery/Dis
zkCli> playService/
#Mon Aug 10 14:37:47 BST 2009



2009/8/10 David Bosschaert <>:
> Hi Thomas,
> Here are a couple of pointers.
> If you look at the Discovery demo, the Service Implementation 
> Activator, you can see that in this activator it figures out the host 
> name and sets that in the "osgi.remote.configuration.pojo.address"
> property:
> l/src/main/java/org/apache/cxf/dosgi/samples/discovery/impl/Activator.
> java So you could do something similar when setting the property.
> However, if you are setting the property from a static file, this 
> isn't really convenient. Therefore there is some additional support 
> for translating 'localhost' into the machine name/IP addr when its 
> registered in Discovery. If you specify the host in your address 
> property as 'localhost', the zookeeper code will do a lookup on your 
> machine name and register it under that (or the IP address). So in my 
> case I'm getting the following registration in ZooKeeper:
> zkCli> ls 
> zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery/D
> zkCli> isplayService
>  []
> So it translated 'localhost' into
> However, looking at the properties inside the registration, I see that 
> 'localhost' is still in there:
> zkCli> get 
> zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery/D
> zkCli> isplayService/
> #
> #Mon Aug 10 10:50:22 BST 2009
> osgi.remote.endpoint.location=http\://localhost\:9100/display
> objectClass=[Ljava.lang.String;@1292ba7
> osgi.remote.interfaces=*
> osgi.remote.configuration.pojo.address=http\://localhost\:9100/display
> osgi.remote.configuration.type=pojo
> ...
> So that's clearly a bug, I've filed
> and will try to fix 
> this over the coming few days.
> Hope this helps,
> David
> 2009/8/7 Shulok, Thomas <>:
>> Hi All,
>> Working with the Zookeeper discovery setup, and things are working as 
>> long as I explicitly specify in my service 
>> decoration xml file. If I don't specify it, it will default to 
>> localhost. Not unreasonable, but the problem is, localhost will be 
>> the endpoint that gets registered with Zookeeper. So, when another 
>> box looks for the interface, Zookeeper will tell it that it is on localhost (i.e.
>> the client itself), and that will fail. With this setup, do you have 
>> to explicitly specify the endpoint, or is there some other default 
>> behavior to leverage that will actually use the real IP of the 
>> registering localhost when it gets entered into Zookeeper so other 
>> clients can find it?
>> Many thanks,
>> Thom

View raw message