Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] getting started with ECF

Hi David,

David Donohue wrote:
Thanks so much, Scott for your most thoughtful reply!  It appears that
there is no such method
containerFactory.createContainer(String, String)
so I cannot do this
containerFactory.createContainer("ecf.generic.server","ecftcp://localhost:3282/server");

Most of the createContainer() methods require an ID as an argument,
but it seems that to create an ID, I need a container!  (Circular
situation).  I do not know how to create the proper namespace.
I am sure I am missing something silly.  Many thanks for setting me straight.

Either of these will work:

final IContainer server = containerFactory.createContainer("ecf.generic.server", new Object[] {"ecftcp://localhost:3282/server" }); final IContainer server = containerFactory.createContainer("ecf.generic.server", IDFactory.getDefault().createStringID("ecftcp://localhost:3282/server"));

Also, earlier today I've added support for creating a server container this way

final IContainer server = containerFactory.createContainer("ecf.generic.server");

as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=290291

Scott


Best,
Dave Donohue

On Wed, Sep 23, 2009 at 1:03 PM, Scott Lewis <slewis@xxxxxxxxxxxxxxxxx> wrote:
Hi David,

David Donohue wrote:
Hello!
ECF looks like just what I need.  I have 2 questions.

My first question is: which protocols, service APIs, & architecture
should I use?
I want to have clustered OSGi applications, to permit handling a large
load on my calculation-intensive Eclipse RAP web application.  I would
like to have my UI running as one OSGi instance.  This UI would
balance load of many users by connecting to distributed data servers,
each running as OSGi service, and each storing the data for a
different set of users.  These OSGi services might be running on the
same physical box or on distinct machines, within a network.  The
client would be doing data operations.  Ideally I could share objects
between client and servers.

Interesting.  Incidently, I (Scott) have been working on a load balancing
system for my employer (EclipseSource).  I intend to present some of the
work at Markus' and my ESE talk [1].  It load balances remote service
requests (i.e. individual method calls on the service interface).  We are
using this to do load balancing of P2 planner operations...as the P2 planner
can be computationally intensive for large numbers of features/IUs.

We are currently using JMS/ActiveMQ as the remote service provider for
ECF...because (among other reasons), JMS/ActiveMQ has support for load
balancing semantics (distributing messaging/requests over n Queue
consumers), and we can just use that to do load balancing of remote services
rather than implement the load balancing semantics ourselves.


My second question is: how do I get started?  I followed these
instructions.

http://wiki.eclipse.org/Getting_Started_with_Using_the_ECF_Remote_Services_API
and I disabled r-OSGi on my Eclipse IDE.  However I still get this
message when starting the service host:
WARNING: Port 9278 already in use. This instance of R-OSGi is running
on port 9279

Yes.  This will/does happen when multiple instances of r-OSGi are run
localhost, because r-OSGi assumes a default port.  r-OSGi does allow
specification of the default port via a system property (i.e. see this page
for some info about this  [2] ).  There is also an enhancement request to
allow container creators to specify the port for r-OSGi to listen on [3].

So I thought I would use a different protocol.  I tried
ecf.generic.client and ecf.generic.server.  But when I start the host
I get an exception

...Caused by: java.lang.IllegalArgumentException: Port value out of range:
-1
       at java.net.ServerSocket.<init>(ServerSocket.java:180)
       at java.net.ServerSocket.<init>(ServerSocket.java:141)
       at org.eclipse.ecf.provider.comm.tcp.Server.<init>(Server.java:39)
       at
org.eclipse.ecf.provider.generic.TCPServerSOContainerGroup.putOnTheAir(TCPServerSOContainerGroup.java:65)
       ...

This error is because the ecf generic provider needs to be told what it's
URI/ID is upon construction (it doesn't have a default).  This is done with
a line like:

IContainer container =
containerFactory.createContainer("ecf.generic.server","ecftcp://localhost:3282/server");
 <- note the protocol,host,port,path

I've opened a new bug [4] to enhance the generic provider to allow a default
URI (like above) to be set automatically.  In the mean time, you will need
to specify the ID yourself (e.g. as above).


Bonus question:
It seems that the ECF update site(s) have been down the last few days?

We are now making ECF daily builds (for ECF 3.1) available as p2 repos
[5]...and you should be able to get the daily builds (for 3.1 stream) from
those repos.  If you are having any trouble with getting/installing from the
given location, please do let us know.


Thanks for your help!

No problem.  Please do let us all know what further needs you have WRT your
project and we will do what we can to help.

Scott


David Donohue

[1] http://www.eclipsecon.org/summiteurope2009/sessions?id=878
[2]
http://wiki.eclipse.org/Getting_Started_with_ECF%27s_RFC119_Implementation
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=267521
[4] https://bugs.eclipse.org/bugs/show_bug.cgi?id=290291
[5] http://dev.eclipse.org/mhonarc/lists/ecf-dev/msg02913.html



_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top