Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] remote services, load balancing

Hello,

I am moving the discussion (http://www.eclipse.org/forums/index.php?t=rview&goto=528121&th=166590#msg_528121) to the mailing list as requested by Scott.

Sorry if this e-mail is too long. I will explain the use-case I am trying to implement.

Consider two or more OSGi platforms. Each platform exports (remote) services that the other platforms can use.
At any time a new platform can appear (or disappear) and the other platforms should be able to see and use the new services without any additional
configuration or restart.
Because some of the services are expensive and time-consuming operations I want to be able to deploy them on
several machines and the requests to these services to be load-balanced. In addition, I want to be transparent for a consumer
if a local or a remote service is used. I don't want in my code to import any OSGi packages.

For the platform and remote services implementations I am using Equinox and ECF.

Now I know that if we remove the load-balancing requirement all this can be implemented with (remote) declarative services.
Moreover, the distribution and discovery providers can be independently selected.

However, the OSGI specification does not say anything about load-balancing, so one has to use some “nonstandard” approach and
stick to specific distribution and discovery providers (and external components) – is my understanding correct?

The ECF has a solution to load-balance remote-services with JMS/ActiveMQ.
For my use-cases it is OK to use ECF ActiveMQ provider and maintain separate ActiveMQ installations. However, is it possible the
usage of services to be transparent for the consumers? The service providers define the properties (local, remote, load-balanced)
of their implementation and the consumers just use the services?

I tried to convert the org.eclipse.ecf.examples.loadbalancing.* examples to declarative services and to remove all ECF references from the code
but with no success.

The conversion of org.eclipse.ecf.examples.loadbalancing.server to declarative services is straightforward.

About org.eclipse.ecf.examples.loadbalancing.servicehost I created the following OSFI-INF/component.xml:

<?xml version="1.0" encoding="UTF-8"?>

   <implementation class="null" />
   <property name="service.exported.interfaces" type="String" value="*"/>
   <property name="service.exported.configs" type="String" value="ecf.jms.activemq.tcp.manager.lb.svchost"/>
   <property name="org.eclipse.ecf.containerFactoryArgs">
       tcp://192.168.1.1:61616/exampleQueue
       tcp://192.168.1.1:61616/exampleTopic
   </property>
   <property name="ecf.rsvc.proxy" type="String" value="true"/> 
   <service>
      <provide interface="org.eclipse.ecf.examples.loadbalancing.IDataProcessor"/>
   </service>
   <reference cardinality="1..1" interface="org.eclipse.ecf.core.IContainerFactory" name="IContainerFactory" policy="static"/>
</scr:component>

Should I use the service.exported.interfaces property? Is <implementation class="null" /> correct?

The main problem I have is with org.eclipse.ecf.examples.loadbalancing.consumer.
I created the following OSGI-INF/component.xml file:

<?xml version="1.0" encoding="UTF-8"?>

   <implementation class="org.eclipse.ecf.internal.examples.loadbalancing.consumer.DataProcessorConsumerApplicationDS"/>
   <reference bind="doTests" cardinality="0..n" interface="org.eclipse.ecf.examples.loadbalancing.IDataProcessor" name="IDataProcessor" policy="dynamic"/>
</scr:component>

Is this somehow related to DefaultProxyContainerFinder and should I specify “ecf.jms.activemq.tcp.client” in the config file?
How is "cardinality" handled in the case of load-balanced service?

I would appreciate any help or directions how to proceed.
More important, is my use-case achievable with Equinox and ECF?

Thank you in advance!

Best regards,
Greg



Back to the top