|
Distributed OSGi - Consuming services deployed in different container instances -
04-17-2009, 09:07 AM
I am fairly new to the whole OSGi concept, but have looked through some tutorials, read quite a bite and find it very interesting. We will soon start testing it out with our existing products and gradually migrate them all to be OSGi bundles if we find it to be a better alternative than today’s solution.
Our service architecture as of today is very simple – a bunch of web services bundled in multiple war files and deployed in Tomcat. It is easy for our clients to consume our services, but when we have different services consuming each other over soap/http when they are running in the same JVM, some unnecessary overhead is created. Ideally they should be able to consume each other without “going external” via soap/http, and that is one of main the reasons why we are considering OSGi.
We do however have some concerns which I have been unable to find answers to:
Some of our services are stateless, hence they are today very easy to scale: Set up a new node with Tomcat, drop the war file in the webapps dir and add the host IP address to the load-balancer. Some of these services do however need to consume other services that due to transactional issues may only have one running instance. Since all services communicate using soap/http this is easily solved by just pointing at the same web service url, but how can this be solved with OSGi? Are there any OSGi containers that supports service exporting/consuming across multiple running OSGi containers.
To exemplify what we need, let’s consider the services/bundles MultipleDeploymentService and TransactionalService. MultipleDeploymentService can be deployed to multiple OSGi runtimes/computers for scalability, while TransactionalService can only be deployed once due to transactional integrity. MultipleDeploymentService depends on TransactionalService. Now let’s say we have two comptures, A and B and want to use them for deploying our two osgi bundles:
Computer1:
-MultipleDeploymentService
-TransactionalService
Computer2:
-MultipleDeploymentService
On computer1 it should be very straight forward for MultipleDeploymentService to consume TransactionalService, but what about Computer 2?
Since the two JVMs don’t share the same heap I guess there are some issues here, but I’m asking anyway.. is it somehow possible for the MultipleDeploymentService running on Computer2 to consume TransactionalService on computer1? If yes: how transparent can this be; may the two osgi containers be linked in some way and use a common service registry? Is this covered by the OSGi standard or are there any of the OSGi containers that supports this or similar behavour "on the side"?
With many thanks,
Geir
|