1

As described in the header 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?

Thank you for help and best regards!

UPDATE:

Ok one update: When the remote service is discovered I fetched it in a local parameter on client side. When the remote service is unpublished on client side (NOT on server side, as described in my previous post) I can call methods from the fetched instance. So the proxy is still available and it is working fine until I unpublish the remote service on server side. So the proxy is unpublished only in OSGI service registry.

Best regards!

0 Answers0