Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Remote Services over ECF XMPP
Remote Services over ECF XMPP [message #624070] Thu, 25 September 2008 15:47 Go to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Hi,

this should be really simple but we couldnt figure out how to do this.

We trying to get a Remote Service example over XMPP to run (our own simple example). The Service Interface simply
transfers Strings forward and backward and we try that with the client and server in separate JVMs and a local JABBER
server (Open Fire).

Client and Server connect successfully with different userids. The Server registers its Services over the ECF API.
However these remote services dont show up on the client as OSGi Services as Proxy. We have set the property on the
server to AUTOREGISTER_PROXY so it should do it. (I think)

I am also dont understand how it is supposed to work. I mean the client has "userid1" the server uses "userid2". Since
that is the information you pass in when you connect, how does "1" find the services from "2"? That was more obvious
when we tried R-OSGi and the generic Service protocol because there the client directly connected to the server. Here
with XMPP both connect to the XMPP server (broker) what the next (missing) step ?

Any hints is appreciated. We can post code if that is helpful but I think I am missing a fundamental point here.

We already looked through the samples and testcases in CVS. They are all not helpful for what we want because the
testcases there run in one JVM, which is maybe good for testing but not good for showcasing what is server and what is
client code.

I also think that the XMPP Testcases runs without an actually XMPP server simply by loopback magic within the JVM but I
am not sure about this.


thanks a lot

christian campo
Re: Remote Services over ECF XMPP [message #624072 is a reply to message #624070] Sat, 27 September 2008 00:26 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Christian,

Christian Campo wrote:
> Hi,
>
> this should be really simple but we couldnt figure out how to do this.
>
> We trying to get a Remote Service example over XMPP to run (our own
> simple example). The Service Interface simply transfers Strings forward
> and backward and we try that with the client and server in separate JVMs
> and a local JABBER server (Open Fire).
>
> Client and Server connect successfully with different userids. The
> Server registers its Services over the ECF API. However these remote
> services dont show up on the client as OSGi Services as Proxy. We have
> set the property on the server to AUTOREGISTER_PROXY so it should do it.
> (I think)


>
> I am also dont understand how it is supposed to work. I mean the client
> has "userid1" the server uses "userid2". Since that is the information
> you pass in when you connect, how does "1" find the services from "2"?
> That was more obvious when we tried R-OSGi and the generic Service
> protocol because there the client directly connected to the server. Here
> with XMPP both connect to the XMPP server (broker) what the next
> (missing) step ?

I suspect that you are missing this on service registration:

final Dictionary props = new Hashtable();
props.put(Constants.SERVICE_REGISTRATION_TARGETS,getClient(1 ).getConnectedID());
final IRemoteServiceRegistration result =
adapter.registerRemoteService(new String[] {serviceInterface}, service,
props);


Because their is no service discovery with XMPP, the registration
explicitly sets a registration target (the getClient(1).getConnectedID()
that is the service client (i.e. where the proxy gets created).

If there is/was a discovery mechanism this wouldn't be necessary, but
for xmpp (alone) it doesn't have discovery so something else is needed.

The code above is available in a test case for xmpp remote services.
That test case is here:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.provider.xmpp/src/org/eclipse/ecf/t ests/provider/xmpp/remoteservice/?root=Technology_Project

>
> Any hints is appreciated. We can post code if that is helpful but I
> think I am missing a fundamental point here.
>
> We already looked through the samples and testcases in CVS. They are all
> not helpful for what we want because the testcases there run in one JVM,
> which is maybe good for testing but not good for showcasing what is
> server and what is client code.


If you have a test infrastructure that supports running tests in more
than one process we would/will be happy to use it and run test cases on
it. We don't have such a test harness, and the junit plugin tests don't
support that out of the Eclipse box anyway.


>
> I also think that the XMPP Testcases runs without an actually XMPP
> server simply by loopback magic within the JVM but I am not sure about
> this.

No, the test case above takes two xmpp logins on (some) remote
server...via system properties. Many/most of the xmpp tests do this,
since we don't run an xmpp server in the test code but do run an xmpp
server at ecf.eclipse.org that we can/do use for testing.

But like I said, we would/will be happy to run tests in a multi-process
environment, but currently we don't have a) a test harness that supports
this; b) access to multiple machines to test in such a manner.

Scott
Re: Remote Services over ECF XMPP [message #624073 is a reply to message #624072] Sat, 27 September 2008 23:10 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Thanks a lot.... One more question....


Scott Lewis schrieb:
> Hi Christian,
>
> Christian Campo wrote:
>> Hi,
>>
>> this should be really simple but we couldnt figure out how to do this.
>>
>> We trying to get a Remote Service example over XMPP to run (our own
>> simple example). The Service Interface simply transfers Strings
>> forward and backward and we try that with the client and server in
>> separate JVMs and a local JABBER server (Open Fire).
>>
>> Client and Server connect successfully with different userids. The
>> Server registers its Services over the ECF API. However these remote
>> services dont show up on the client as OSGi Services as Proxy. We have
>> set the property on the server to AUTOREGISTER_PROXY so it should do
>> it. (I think)
>
>
>>
>> I am also dont understand how it is supposed to work. I mean the
>> client has "userid1" the server uses "userid2". Since that is the
>> information you pass in when you connect, how does "1" find the
>> services from "2"? That was more obvious when we tried R-OSGi and the
>> generic Service protocol because there the client directly connected
>> to the server. Here with XMPP both connect to the XMPP server (broker)
>> what the next (missing) step ?
>
> I suspect that you are missing this on service registration:
>
> final Dictionary props = new Hashtable();
> props.put(Constants.SERVICE_REGISTRATION_TARGETS,getClient(1 ).getConnectedID());
>
> final IRemoteServiceRegistration result =
> adapter.registerRemoteService(new String[] {serviceInterface}, service,
> props);

OK so here the server tells what client will see this service. What would be the way if the server is just the server
and knows its services and I'd like to register a proxy on the client either in OSGi oder ECF to access a known Service
on a known Service ID? So in the scenaria where multiple clients wants to access a service.
>
>
> Because their is no service discovery with XMPP, the registration
> explicitly sets a registration target (the getClient(1).getConnectedID()
> that is the service client (i.e. where the proxy gets created).
>
> If there is/was a discovery mechanism this wouldn't be necessary, but
> for xmpp (alone) it doesn't have discovery so something else is needed.
>
> The code above is available in a test case for xmpp remote services.
> That test case is here:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.provider.xmpp/src/org/eclipse/ecf/t ests/provider/xmpp/remoteservice/?root=Technology_Project
>
>
>>
>> Any hints is appreciated. We can post code if that is helpful but I
>> think I am missing a fundamental point here.
>>
>> We already looked through the samples and testcases in CVS. They are
>> all not helpful for what we want because the testcases there run in
>> one JVM, which is maybe good for testing but not good for showcasing
>> what is server and what is client code.
>
>
> If you have a test infrastructure that supports running tests in more
> than one process we would/will be happy to use it and run test cases on
> it. We don't have such a test harness, and the junit plugin tests don't
> support that out of the Eclipse box anyway.
>
>
>>
>> I also think that the XMPP Testcases runs without an actually XMPP
>> server simply by loopback magic within the JVM but I am not sure about
>> this.
>
> No, the test case above takes two xmpp logins on (some) remote
> server...via system properties. Many/most of the xmpp tests do this,
> since we don't run an xmpp server in the test code but do run an xmpp
> server at ecf.eclipse.org that we can/do use for testing.
>
> But like I said, we would/will be happy to run tests in a multi-process
> environment, but currently we don't have a) a test harness that supports
> this; b) access to multiple machines to test in such a manner.
>
> Scott
christian
Re: Remote Services over ECF XMPP [message #624075 is a reply to message #624073] Mon, 29 September 2008 23:19 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Christian,

Christian Campo wrote:
<stuff deleted>

>
> OK so here the server tells what client will see this service. What
> would be the way if the server is just the server and knows its services
> and I'd like to register a proxy on the client either in OSGi oder ECF
> to access a known Service
> on a known Service ID? So in the scenaria where multiple clients wants
> to access a service.

Yes. I've created an enhancement request to deal with this use case,
and I've begun implementation.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=249061

Please add yourself to the bug if you are interested...it should be done
pretty quickly...and I would like to ask you to help test it obviously.

Scott
Previous Topic:(Re-) connect bug in org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer#connect ?
Next Topic:How to use ECF for conference calls
Goto Forum:
  


Current Time: Tue Mar 19 05:54:27 GMT 2024

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

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

Back to the top