Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » remote services, load balancing
remote services, load balancing [message #528121] Mon, 19 April 2010 12:38 Go to next message
Greg  is currently offline Greg
Messages: 4
Registered: April 2010
Junior Member
Hello,

I am trying to figure out how to integrate/implement a load balancing solution for declarative, automatically discoverable remote services.

I tried the examples
org.eclipse.ecf.examples.remoteservices.hello.ds.consumer
org.eclipse.ecf.examples.remoteservices.hello.ds.host
and they work just great.

I started several instances of hello.ds.host on different computers in a local network and they are successfully discovered (slp). A hello.ds.consumer instance can use the remote services (ecf generic).

Then I tried the examples
org.eclipse.ecf.examples.loadbalancing.consumer
org.eclipse.ecf.examples.loadbalancing.server
org.eclipse.ecf.examples.loadbalancing.servicehost
(btw thanks for the wiki page http://wiki.eclipse.org/Load_Balancing_Remote_Services).
They are also working fine, although I do not quite understand all the details. Could I kindly ask you to provide more details what is happening in DataProcessorServiceHostApplication (org.eclipse.ecf.examples.loadbalancing.servicehost)? LOAD_BALANCING_SERVICE_PROPERTY is mentioned in the code, also there is Constants.SERVICE_REGISTER_PROXY - I am a bit confused.

Generally my question is how can I integrated load balancing for remote services using ECF (and its implementations)? My best case would be to register (remote) services as in the org.eclipse.ecf.examples.remoteservices.hello.ds.* and then to "automagically" "turn on" the load balancing. Is this possible?


Sorry if my questions do not make sense, I'm pretty new to OSGI and ECF.
Thanks for the great work so far!

Regards,
Greg
Re: remote services, load balancing [message #528557 is a reply to message #528121] Tue, 20 April 2010 23:37 Go to previous messageGo to next message
Scott Lewis is currently offline Scott Lewis
Messages: 970
Registered: July 2009
Senior Member
Hi Greg,

Greg wrote:
> Hello,
>
> I am trying to figure out how to integrate/implement a load balancing
> solution for declarative, automatically discoverable remote services.
>
> I tried the examples
> org.eclipse.ecf.examples.remoteservices.hello.ds.consumer
> org.eclipse.ecf.examples.remoteservices.hello.ds.host
> and they work just great.


Very good.


>
> I started several instances of hello.ds.host on different computers in a
> local network and they are successfully discovered (slp). A
> hello.ds.consumer instance can use the remote services (ecf generic).
>
> Then I tried the examples
> org.eclipse.ecf.examples.loadbalancing.consumer
> org.eclipse.ecf.examples.loadbalancing.server
> org.eclipse.ecf.examples.loadbalancing.servicehost
> (btw thanks for the wiki page
> http://wiki.eclipse.org/Load_Balancing_Remote_Services).
> They are also working fine,


Great!


although I do not quite understand all the
> details.


>Could I kindly ask you to provide more details what is
> happening in DataProcessorServiceHostApplication
> (org.eclipse.ecf.examples.loadbalancing.servicehost)?

Sure.
> LOAD_BALANCING_SERVICE_PROPERTY is mentioned in the code, also there is
> Constants.SERVICE_REGISTER_PROXY - I am a bit confused.

This line (72 in DataProcessorServiceHostApplication):

properties.put(Constants.SERVICE_REGISTER_PROXY, "true");

Signals to the load balancing service host to *not* actually register
the object, but rather register a *proxy* to the actual host.

Inside of the implementation of the jms container (container
type=ecf.jms.activemq.tcp.manager.lb.svchost), this service property
being set indicates to the implementation that rather register the
object itself, a load-balancing proxy is to be created...and in the case
of the jms implementation this proxy uses the JMS Queue to deliver each
method invocation requests (of the service interface) to 1 of n possible
service hosts...i.e. here's the basic architecture:

service client <- JMS topic -> svc host <--> jms queue -> svc server 1
-> svc server 2
-> svc server 3
...

The end effect of this is that individual method calls by the client (on
the service interface), are first sent to the svc host process (over JMS
topic), then the svc host simply forwards those individual requests to a
JMS queue. The JMS queue has n receivers (the servers), and the JMS
queue semantics are to deliver individual messages to target receivers
(the svc server) in a round robin strategy.

>
> Generally my question is how can I integrated load balancing for remote
> services using ECF (and its implementations)? My best case would be to
> register (remote) services as in the
> org.eclipse.ecf.examples.remoteservices.hello.ds.* and then to
> "automagically" "turn on" the load balancing. Is this possible?


Yes. This is done by adding svc server instances to the jms queue as
receivers. In the example code, the svc servers are implemented by the
org.eclipse.ecf.examples.loadbalancing.server project
(DataProcessorServerApplication). With the architecture above, if
multiple svc servers are started/added (even dynamically) as receivers
to the jms queue, then load balancing individual service requests will
'just happen'.

Note that since the individual method invocation requests/responses go
to different target svc servers (i.e. in general in different processes
and possibly on different physical machines), the service *cannot* be
stateful...unless there is some other communication between the svc
servers (which is possible, of course...e.g. through other ECF pub/sub
containers), but is not the case in this load balancing example code.

>
> Sorry if my questions do not make sense, I'm pretty new to OSGI and ECF.
> Thanks for the great work so far!


Thanks for the nice words. It would be most appreciated if we could
have any additional or follow up dialog about this on the ecf-dev
mailing list, since that is where more ECF community members and
committers 'hang out'...and it may be that your questions and answers
are interesting/helpful to others (since we have continuously limited
bandwidth for examples, documentation, etc). You can join the ecf-dev
mailing list by going here:

https://dev.eclipse.org/mailman/listinfo/ecf-dev

Thanks...and for using ECF. If you do something with ECF and are able
to contribute back (e.g. example code, etc), or even are willing to
describe your work publicly (on the ECF mailing list, etc)...all of this
would be appreciated.

Scott
Re: remote services, load balancing [message #529556 is a reply to message #528557] Mon, 26 April 2010 11:35 Go to previous messageGo to next message
Greg  is currently offline Greg
Messages: 4
Registered: April 2010
Junior Member
Thank you Scott, I moved the discussion on the ecf-dev - http://dev.eclipse.org/mhonarc/lists/ecf-dev/msg03556.html
Re: remote services, load balancing [message #625205 is a reply to message #528121] Tue, 20 April 2010 23:37 Go to previous messageGo to next message
Scott Lewis is currently offline Scott Lewis
Messages: 970
Registered: July 2009
Senior Member
Hi Greg,

Greg wrote:
> Hello,
>
> I am trying to figure out how to integrate/implement a load balancing
> solution for declarative, automatically discoverable remote services.
>
> I tried the examples
> org.eclipse.ecf.examples.remoteservices.hello.ds.consumer
> org.eclipse.ecf.examples.remoteservices.hello.ds.host
> and they work just great.


Very good.


>
> I started several instances of hello.ds.host on different computers in a
> local network and they are successfully discovered (slp). A
> hello.ds.consumer instance can use the remote services (ecf generic).
>
> Then I tried the examples
> org.eclipse.ecf.examples.loadbalancing.consumer
> org.eclipse.ecf.examples.loadbalancing.server
> org.eclipse.ecf.examples.loadbalancing.servicehost
> (btw thanks for the wiki page
> http://wiki.eclipse.org/Load_Balancing_Remote_Services).
> They are also working fine,


Great!


although I do not quite understand all the
> details.


>Could I kindly ask you to provide more details what is
> happening in DataProcessorServiceHostApplication
> (org.eclipse.ecf.examples.loadbalancing.servicehost)?

Sure.
> LOAD_BALANCING_SERVICE_PROPERTY is mentioned in the code, also there is
> Constants.SERVICE_REGISTER_PROXY - I am a bit confused.

This line (72 in DataProcessorServiceHostApplication):

properties.put(Constants.SERVICE_REGISTER_PROXY, "true");

Signals to the load balancing service host to *not* actually register
the object, but rather register a *proxy* to the actual host.

Inside of the implementation of the jms container (container
type=ecf.jms.activemq.tcp.manager.lb.svchost), this service property
being set indicates to the implementation that rather register the
object itself, a load-balancing proxy is to be created...and in the case
of the jms implementation this proxy uses the JMS Queue to deliver each
method invocation requests (of the service interface) to 1 of n possible
service hosts...i.e. here's the basic architecture:

service client <- JMS topic -> svc host <--> jms queue -> svc server 1
-> svc server 2
-> svc server 3
...

The end effect of this is that individual method calls by the client (on
the service interface), are first sent to the svc host process (over JMS
topic), then the svc host simply forwards those individual requests to a
JMS queue. The JMS queue has n receivers (the servers), and the JMS
queue semantics are to deliver individual messages to target receivers
(the svc server) in a round robin strategy.

>
> Generally my question is how can I integrated load balancing for remote
> services using ECF (and its implementations)? My best case would be to
> register (remote) services as in the
> org.eclipse.ecf.examples.remoteservices.hello.ds.* and then to
> "automagically" "turn on" the load balancing. Is this possible?


Yes. This is done by adding svc server instances to the jms queue as
receivers. In the example code, the svc servers are implemented by the
org.eclipse.ecf.examples.loadbalancing.server project
(DataProcessorServerApplication). With the architecture above, if
multiple svc servers are started/added (even dynamically) as receivers
to the jms queue, then load balancing individual service requests will
'just happen'.

Note that since the individual method invocation requests/responses go
to different target svc servers (i.e. in general in different processes
and possibly on different physical machines), the service *cannot* be
stateful...unless there is some other communication between the svc
servers (which is possible, of course...e.g. through other ECF pub/sub
containers), but is not the case in this load balancing example code.

>
> Sorry if my questions do not make sense, I'm pretty new to OSGI and ECF.
> Thanks for the great work so far!


Thanks for the nice words. It would be most appreciated if we could
have any additional or follow up dialog about this on the ecf-dev
mailing list, since that is where more ECF community members and
committers 'hang out'...and it may be that your questions and answers
are interesting/helpful to others (since we have continuously limited
bandwidth for examples, documentation, etc). You can join the ecf-dev
mailing list by going here:

https://dev.eclipse.org/mailman/listinfo/ecf-dev

Thanks...and for using ECF. If you do something with ECF and are able
to contribute back (e.g. example code, etc), or even are willing to
describe your work publicly (on the ECF mailing list, etc)...all of this
would be appreciated.

Scott
Re: remote services, load balancing [message #625212 is a reply to message #528557] Mon, 26 April 2010 11:35 Go to previous message
Greg  is currently offline Greg
Messages: 4
Registered: April 2010
Junior Member
Thank you Scott, I moved the discussion on the ecf-dev - http://dev.eclipse.org/mhonarc/lists/ecf-dev/msg03556.html
Previous Topic:Download failure using Project Set File
Next Topic:ECF problem
Goto Forum:
  


Current Time: Wed Oct 01 08:30:41 GMT 2014

Powered by FUDForum. Page generated in 0.10917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software