Allen Xudong Cheng
Allen Xudong Cheng

Reputation: 170

How to do load balancing in distributed OSGi?

We deploy two service instance in difference machine using CXF distributed OSGi. we want to give the system the load balancing feature. All we know the OSGi don't provide any load balancing feature. Does anyone know how to do it ?

Upvotes: 2

Views: 792

Answers (2)

Christian Schneider
Christian Schneider

Reputation: 19626

You should be able to get the complete list of services using a ServiceTracker. So a nice way to create a load balancer should be to create a proxy service yourself that does the load balancing and publish it locally as a service with a special property. So your business application can use the service without knowing anything about the details of load balancing.

Upvotes: 0

Neil Bartlett
Neil Bartlett

Reputation: 23958

Load balancing is a concern that is meant to be implemented by the Topology Manager (TM). It would be useful to read the Remote Services Admin specification, which addresses exactly this kind of question.

As far as I know, the CXF implementation of Remote Services only implements a single TM, which is "promiscuous", i.e. it publishes every available service in every listening framework. It is possible however to write your own TM to perform load balancing and failover etc.

The Remote Services spec is written in such a way that a TM implementation can be developed completely independently of any specific Remote Services implementation.

Upvotes: 2

Related Questions