Hi guys,
many thanks for all those helpful replies on my request.
I already thought about running CXF/DOSGi and ECF in one OSGi
environment. Since this is the Apache Felix container on the "server
side" in my case, I could try to run ECF in Felix (I heard about
this project to achive this: https://github.com/ECF/ECF4Felix) and
try to publish the service in parallel on Apache Zookeeper via the
ECF discovery implementation. Then the ECF based consumer running in
Eclipse Equinox should have no problems discovering and using the
service that resides in Apache Felix. Maybe this is the easiest way
to reach my goal.
Just to bring the other idea to an end: Ahmed wrote:
"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) .
"
The best solution for me would be one without the need to modify or
add/install anything on the "server side" (Apache Felix, existing
service exported by CXF/DOSGI over SOAP/HTTP). If l would be able to
modify the ECF discovery to find a CXF/DOSGI exported service, do I
have to expect any other issues concerning the communication between
the service exported by CXF/DOSGI over SOAP/HTTP and the ECF
consumer using r-osgi?
Many thanks in advance.
Cheers,
Marcus
Am 23.06.2011 12:24, schrieb ahmed.aadel@xxxxxxxxxxxxxxxxxx:
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
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
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev
|