[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Consuming a CXF/DOSGi based Service with ECF Client?


On 6/22/2011 5:35 AM, Marcus Engelhardt wrote:
I think CXF/DOSGi does register an XML description of the service. In case of my test service this look like:

<?xml version="1.0" encoding="UTF-8"?>
<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0";>
<property name="endpoint.framework.uuid" value="7464d128-cdc6-4817-bba8-c89ac18f2d54" />
<property name="endpoint.id" value="http://localhost:9191/libraryservice"; />
<property name="endpoint.package.version.de.bht.pfk.serviceinterface" value="0.0.0" />
<property name="endpoint.service.id" value-type="Long" value="31" />
<property name="objectClass">
<property name="org.apache.cxf.rs.address" value="http://localhost:9191/libraryservice"; />
<property name="org.apache.cxf.rs.databinding" value="jaxb" />
<property name="service.imported" value="true" />
<property name="service.imported.configs">
<property name="service.intents">

On the other hand, ECF seems to write the serialization of an IServiceInfo object (wrapped into an org.eclipse.ecf.provider.zookeeper.core.AdvertisedService object) to the ZooKeeper node. The output of ZooKeeper for such a node is:

¼Ý ?sr ?java.util.HashMap?+-+?`Ð? ?F
loadFactorI thresholdxp?@ ? t ?discovery.service.locationsr
?java.net.URI¼?x.C×I½? ?L ?stringt ?Ljava/lang/String;xpt Cecf.osgirsvc://localh
ost:9278/osgirsvc_9s+cJod3za4BEOTmyD7Y6i4nSD4=xt ?node.property.name.protocolsur
?[Ljava.lang.String;¡ÊVþÚ?{G? xp ?t defaultt ?node.property.name.servicesuq
~ ?t ?ecf.osgirsvct §node.property.name.nat ?ianat ?discovery.service.priority
sr ?java.lang.Integer?Ôáñ¸?ç8? ?I ?valuexr ?java.lang.Numberå¼ò??öÓï? xp t ?
discovery.service.weightq ~ ?t node.property.service.propertiessr +org.eclipse.
ecf.discovery.ServiceProperties±ºƒ¢ô-ƒ2? ?L ?propst ?Ljava/util/Properties;xpsr
¶java.util.Properties9?ðzp6>ÿ? ?defaultsq ~ ?xr ?java.util.Hashtable?+¤%!Jõ©? ?F

loadFactorI thresholdxp?@ ? t ?endpoint.service.idt ?58t Fen
dpoint.package.version.org.eclipse.ecf.examples.remoteservices.hellot ?3.0.0t ?o
bjectClasst 4org.eclipse.ecf.examples.remoteservices.hello.IHellot ?endpoint.fra
mework.uuidt $3815d16d-d0fb-40b8-8922-260ebb056fb8t ?remote.intents.supportedt ?
passByValue exactlyOnce orderedt ?ecf.endpoint.id.nst ¶ecf.namespace.r_osgit ?re
mote.configs.supportedt ¤ecf.r_osgi.peert ?endpoint.idt ?r-osgi://localhost:9278
t ?service.imported.configsq ~ )xpt ?node.property.service.namet %osgirsvc_9s+cJ
od3za4BEOTmyD7Y6i4nSD4=t ?node.property.name.scopeq ~ x

The method org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainer::registerService(IServiceInfo serviceInfo) delegates the registration of the service infos to org.eclipse.ecf.provider.zookeeper.node.internal.WatchManager::publish(AdvertisedService published) method.

I think I have to write a new WatchManager implementation to read the CXF/DOSGi XML service descriptions and to build IServiceInfo objects based on these. Is that feasable? Should I replace/extend the implementation or is there a way to register a new one?

I shouldn't be necessary to modify the zookeeper discovery implementation in this way.

From your earlier note you said:

>Unfortunately, the ECF based consumer is not notified by the ZooKeeper discovery service about the presence >of the CXF/DOSGi based service. I am not sure why this is happening.

I think we should first attempt to diagnose why this is (not) happening. Are you using CXF's zookeeper impl to publish the service when exported by CXF? Perhaps there is something about the configuration of that (e.g. port selection, etc) that is not compatible with the ECF consumer zookeeper (?).