Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Remote Services Without OSGi Bundles

DZone's Guide to

Remote Services Without OSGi Bundles

Remote Services and microservices go hand-in-hand. Take a look at how you can make use of them, even without the use of OSGi bundles.

· Microservices Zone ·
Free Resource

Containerized Microservices require new monitoring. See why a new APM approach is needed to even see containerized applications.

Remote Services provides a dynamic, transport-independent, simple, modular way to expose microservices. ECF has created a spec-compliant implementation along with a large and growing number of open and extensible distribution providers.   

Remote services are frequently used for fog/edge use cases, where the communication transports (e.g. MQTT) may be different than those typically used in the cloud (e.g. HTTP/HTTPS, JaxRS, enterprise messaging, etc). Typically, remote services are run on OSGi-based frameworks and apps such as Equinox, Felix, Karaf, Eclipse, and others, and indeed ECF's RSA implementation works very well in any of these environments.  

Perhaps less well known, however, is that remote services can be used in other inter-process environments...for example between Java and Python. It's also possible to use ECF remote services without an OSGi framework, i.e. running only as Java applications. This repository has an example of using ECF remote services without an OSGi framework. The projects are Java applications (no OSGi framework assumed), on both the remote service provider side, as well as the remote service consumer side. The examples may be run within Eclipse by using the launch configs in the example projects.

Most of the benefits of OSGi Remote Services are still available...for example the ability to use multiple distribution providers for a service, the ability to remotely discover services and dynamically respond to network failure, and the ability to use the OSGi service registry for service dynamics, and service injection. Also, the service definition, implementation, registration, and lookup are exactly the same whether via an OSGi bundle or a Java application. This allows services to be defined consistently across runtime environments in addition to cross-distribution mechanisms.

Please clone the ServiceRegistry GitHub repository and give things a try.

Automatically manage containers and microservices with better control and performance using Instana APM. Try it for yourself today.

Topics:
java ,osgi ,framework ,eclipse ,ecf ,microservices ,remote services

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}