Hi Atanas,
On 6/17/2011 5:22 AM, Атанас Тодоров wrote:
Hi All,
We are searching for a way to implement remote
communication between two OSGI based products with ECF.The
base requirement for that is the protocol of communication to
be http based.
Remote services API supports mainly two protocols - ECF
Generic Server and R-OSGI which however are not http
based.Right?
We want this communication to be configured via xml files
or API and NO custom implementation to be needed to support
discovery, serialization/de-serialization, authorization/etc.
A good solution for this seems to be the REST api however
from what we've read there isn't a way to expose the
server's services as rest-based services so that client can
discover them and do post/get with rest api.We've read about
RESTlet+OSGI api which might be a solution for our use case
right?
It might. Although I'm not a Restlet expert, I don't believe
communication with Restlet is typically configured via xml (rather
it uses java annotations to define how method on a java class are
exposed via get/put/post/delete). WRT authentication and
authorization...I'm not sure what you are looking for exactly...so
it's hard to say without more information whether Restlet will meet
your needs. Would you be willing to say more about what you need
here?
As for discovery...ECF's implementation of OSGi remote services/RSA
separates the discovery from the distribution system...which allows
you to choose which discovery you wish to use with *any*
distribution provider (ECF generic, r-osgi, restlet, whatever).
Thus the discovery module can be chosen from the ones ECF has
available (zeroconf, slp, zookeeper, dnssd) irrespective of what
distribution system is used...and so if you don't need/want a custom
discovery implementation, then you can use one of the ones listed.
Now...Restlet wasn't originally designed to run in an OSGi
environment, so that has to be dealt with...forgetting about
ECF/remote services for a moment. Bryan Hunt and others have been
working on an OSGi bridge for Restlet, and it's available here [1].
Further, I've been using this OSGI integration work and the Restlet
API to create an remote services distribution provider. I have it
working...but it needs some further work that I haven't yet been
able to complete...and further I haven't decided what to do with it
yet (i.e. whether to contribute to ECF or not, etc). If you are
interested in working with me on it and/or using it directly from
me, then please contact me directly at slewis at composent.com.
How this Restlet api works? If I have a simple osgi service
is there a way to expose it so that client can discover it
with rest api? Are there any other solutions for this use
case?
I'm not quite clear enough yet on your serialization and
authentication/authorization requirements to say for sure...but it
is possible that r-osgi could meet them (as Markus has already
indicated). It's also possible that the Restlet provider that I've
been working on could support what you need, as (probably) could a
provider based upon jax-rs (which would also be very simple to
create, but such a ECF remote services provider hasn't been
implemented or contributed yet).
Scott
Thanks
Atanas Todorov
[1]
http://code.google.com/a/eclipselabs.org/p/restlet-integration-with-equinox/
|