[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?

Hi Marcus,

Both ECF and CXF/DOSGi  uses ZooKeeper as a tool to implement very differently [1] their own discovery mechanism. But they're not "complaint"  with each other (and shouldn't per se).  
So, if, let's say, in endpoint A you're o.a.  publishing OSGi services using CXF/DOSGi (without any ECF),  you' ll not get those services discovered in endpoint B using ECF (without any CXF/DOSGi). They're not aware of each other's publications as they're using different discovery each.
I hate to answer one question by another, but  mind this one :) Why aren't you running ECF RSA [2] in  in parallel with  CXF/DOSGi  RSA implementation as there is no restriction on the number of Remote Service Admin's you can run within one environment? This way, you get  seamlessly all ECF discovery and distribution power  for free while still using CXF/DOSGi and without any non- OSGi specs bridging need !

>..
>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:

>..
Not the whole  service (IServiceInfo) object but only  its properties are  serialized and written down the underlying ZooKeeper node

>..
>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?

>..
You don't need to. If you still want only to bridge with ECF Discovery allowing service published by CXF/DOSGi to get discovered by ECF, then I think you should publish all (to expose) services by explicitly registering them via ECF Discovery (in this case, have a look in page linked by  [1] on how to do it) .

[1] http://wiki.eclipse.org/Zookeeper_Based_ECF_Discovery
[2] http://eclipseecf.blogspot.com/2011/01/ecf-35-supports-osgi-42-remote-services.html


Hope this helps and please do post back for any further help

Ahmed
remainsoftware.com
 

From: Marcus Engelhardt <bernie_bo@xxxxxx>
To: ecf-dev@xxxxxxxxxxx
Date: 22-06-2011 14:33
Subject: Re: [ecf-dev] Consuming a CXF/DOSGi based Service with ECF Client?





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">
<endpoint-description>
<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">
<array>
<value>de.bht.pfk.serviceinterface.LibraryServiceREST</value>
</array>
</property>
<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">
<array>
<value>org.apache.cxf.rs</value>
</array>
</property>
<property name="service.intents">
<array>
<value>HTTP</value>
</array>
</property>
</endpoint-description>
</endpoint-descriptions>

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?

Marcus

Am 22.06.2011 13:13, schrieb Markus Alexander Kuppe:
> On 06/22/2011 01:03 PM, Marcus Engelhardt wrote:
>> Hello guys,
>>
>> I am trying to consume a service which is exported by Apache CXF/DOSGi
>> to a SOAP/HTTP endpoint. The endpoint is published to the ZooKeeper
>> discovery which stores a note similar to the one described in the
>> corresponding tutorial
>> (
http://cxf.apache.org/dosgi-discovery-demo-page.html). I have also
>> written an ECF based consumer according to the the "Hello World" example
>> (r-osgi, zookeeper) found in the Apache dev repository.
>>
>> 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 also did export the service with
>> ECF which worked very well. Therefore, my questions are:
>>
>> 1) Is it overall possible to consume such a service with a ECF consumer?
> Should be possible. :)
>
>> 2) If yes, what is necessary to accomplish this? Do I have to write an
>> adapter (I recognized that both, ECF and CXF/DOSGi) write the service
>> metadata in different formats to the Zookeeper node) for it?
> What does the metadata look like for ECF and CXF?
>
> Markus
> _______________________________________________
> ecf-dev mailing list
> ecf-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/ecf-dev

_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev