Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » I lose osgi remote service
icon5.gif  I lose osgi remote service [message #1730264] Fri, 22 April 2016 20:47 Go to next message
Tobias Pyttel is currently offline Tobias PyttelFriend
Messages: 3
Registered: April 2016
Junior Member
Hey everyone,
I want to use remote services in an OSGI environment. So I decided to handle this with eclipse ECF. In my opinion a very good project to deal with OSGI remote services. So for the discovery provider I use Zoodiscovery. The services are registered with generic service property. Furthermore, Zoodiscovery is used in centralized mode and the central IP is published with a network broadcast. I got everything to work. But after a period of time the service consumer loses the remote service.

This message is shown when the remote service is discovered:
[log;+0000 2016.04.22 15:26:03:564;DEBUG;org.eclipse.ecf.provider.zookeeper;Service Discovered: ServiceInfo[uri=ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=;id=ServiceID[type=ServiceTypeID[typeName=_ecfosgirsvc._default.default._iana];location=ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=;full=_ecfosgirsvc._default.default._iana@ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=];priority=0;weight=0;props=ServiceProperties[{objectClass=de.custom.service.api.IManagerService, endpoint.id=e9dc7ac1-708d-43a6-b2fa-539beff6c732, remote.intents.supported=passByValue exactlyOnce ordered, ecf.endpoint.id=ecftcp://192.168.178.21:2121/server, ecf.rsvc.id=3, endpoint.service.id=174, service.imported.configs=ecf.generic.server, ecf.endpoint.ts=1461329304080, ecf.generic.server.hostname=192.168.178.21, ecf.endpoint.id.ns=org.eclipse.ecf.core.identity.StringID, remote.configs.supported=ecf.generic.server, endpoint.package.version.de.custom.api=1.0.0, endpoint.framework.uuid=70eaf65a-8608-0016-13af-dcea8562a726}]]]

This message is shown when the remote service is undiscovered:
[log;+0000 2016.04.22 15:28:53:125;DEBUG;org.eclipse.ecf.provider.zookeeper;Service Undiscovered: ServiceInfo[uri=ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=;id=ServiceID[type=ServiceTypeID[typeName=_ecfosgirsvc._default.default._iana];location=ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=;full=_ecfosgirsvc._default.default._iana@ecfosgirsvc://192.168.178.21:32565/osgirsvc_AMIsPeVObufIp5v5cV6pHNIvzGM=];priority=0;weight=0;props=ServiceProperties[{objectClass=de.custom.service.api.IManagerService, endpoint.id=e9dc7ac1-708d-43a6-b2fa-539beff6c732, remote.intents.supported=passByValue exactlyOnce ordered, ecf.endpoint.id=ecftcp://192.168.178.21:2121/server, ecf.rsvc.id=3, endpoint.service.id=174, service.imported.configs=ecf.generic.server, ecf.endpoint.ts=1461329304080, ecf.generic.server.hostname=192.168.178.21, ecf.endpoint.id.ns=org.eclipse.ecf.core.identity.StringID, remote.configs.supported=ecf.generic.server, endpoint.package.version.de.custom.api=1.0.0, endpoint.framework.uuid=70eaf65a-8608-0016-13af-dcea8562a726}]]]


BUT: On host system everything is fine and the service is online. If I restart the OSGI framework on consumer side everything works fine again until this Undiscovery event. The period of time between discovery and undiscovery is equal of length.
It seems as if there is a timeout undiscovering the service. If I use the service by calling a method there is no different behaviour. Has anyone an idea what's going on?

I know that posting same problematic on different forums is not a good idea, but in my opinion this form (which I recognized later :: sorry for that!) is the better one for my question, so I decided to post my problem here in this forum, too.

Thank you for help and bet regards!
icon7.gif  Re: I lose osgi remote service [message #1730410 is a reply to message #1730264] Mon, 25 April 2016 14:33 Go to previous messageGo to next message
Tobias Pyttel is currently offline Tobias PyttelFriend
Messages: 3
Registered: April 2016
Junior Member
So after a period of time I found the solution!

It was very simple: I enabled full debug logging with VM parameter
-Dlog4j.configuration=file:/file/path/to/logging/log4j.properties
with root in INFO mode:

log4j.rootLogger=INFO,stdout
log4j.logger.com.endeca=DEBUG
# Logger for crawl metrics
log4j.logger.com.endeca.itl.web.metrics=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n


This displayed the client session timeout when the remote service was undiscovered (it was set to 4000ms). So after a lot if trial and error the update of network card driver was the solution.

But another point: After dealing with ECF OSGI remote services (Zoodiscovery / generic) I would like to share my experience with a full sample tutorial where I want to show how I made two standalone OSGI Frameworks communicating to each other in a private network on different machines and OS (Windows and Debian) with help of OSGI remote service and ECF. I had some problems with DNS settings and some other stuff which maybe can help other people get their projects done quicker. So where, in your opinion, is the best location to do so?

Best regards!

[Updated on: Mon, 25 April 2016 14:34]

Report message to a moderator

Re: I lose osgi remote service [message #1730416 is a reply to message #1730410] Mon, 25 April 2016 15:10 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi Tobias,

Good to see that you got it to work. It would be great if you could write a tutorial about this. If you want to make it permanent, a good place would be on the ECF wiki [1].

[1] https://wiki.eclipse.org/Eclipse_Communication_Framework_Project#Tutorials

Cheers,

Wim

Re: I lose osgi remote service [message #1730419 is a reply to message #1730416] Mon, 25 April 2016 15:30 Go to previous messageGo to next message
Tobias Pyttel is currently offline Tobias PyttelFriend
Messages: 3
Registered: April 2016
Junior Member
Cool!

I will prepare a tutorial until next week and I will use the mailing list for further steps.

Best wishes
Tobias
Re: I lose osgi remote service [message #1730426 is a reply to message #1730410] Mon, 25 April 2016 17:21 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Tobias Pyttel wrote on Mon, 25 April 2016 10:33
So after a period of time I found the solution!

It was very simple: I enabled full debug logging with VM parameter
-Dlog4j.configuration=file:/file/path/to/logging/log4j.properties
with root in INFO mode:

log4j.rootLogger=INFO,stdout
log4j.logger.com.endeca=DEBUG
# Logger for crawl metrics
log4j.logger.com.endeca.itl.web.metrics=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n


This displayed the client session timeout when the remote service was undiscovered (it was set to 4000ms). So after a lot if trial and error the update of network card driver was the solution.

But another point: After dealing with ECF OSGI remote services (Zoodiscovery / generic) I would like to share my experience with a full sample tutorial where I want to show how I made two standalone OSGI Frameworks communicating to each other in a private network on different machines and OS (Windows and Debian) with help of OSGI remote service and ECF. I had some problems with DNS settings and some other stuff which maybe can help other people get their projects done quicker. So where, in your opinion, is the best location to do so?

Best regards!


Hi Tobias.

As Wim says, you would be most welcome to add a tutorial to the Tutorials section on the ECF wiki:

https://wiki.eclipse.org/Eclipse_Communication_Framework_Project#Tutorials

To do this you need to have a login to the wiki (to edit). If you don't already have one you can get one here:

https://dev.eclipse.org/site_login/createaccount.php

Also, it might be a good idea to join the ecf-dev mailing list:

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

and I would suggest announcing that you are creating such a tutorial on that list. There may be others that would help with the tutorial creation, formatting, and/or review (I'm certainly one of those...I will help you get things figured out, and help with content and/or references if you would like it).

Glad to hear you are having success using ECF. BTW, you might want to check out some of the other distribution providers (websockets, jax-rs, hazelcast, activemq, etc), discovery providers (etcd), and other goodies like the ServiceRegistry work (java-only remote services): https://github.com/ECF/ServiceRegistry at https://github.com/ECF

Thanks...and if you have any technical questions, directional/plan questions, etc., please post to the mailing list.

Scott
Previous Topic:Different ECF versions, does it work? (Mars and Juno)
Next Topic:ECF r-osgi : NPEs in proxies during startup
Goto Forum:
  


Current Time: Thu Apr 25 09:01:58 GMT 2024

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

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

Back to the top