JAX Developers Puzzle deadline approaching: Play for a chance to win a complimentary JAX London 2018 ticket!
OSGi and open source

Build your own open source Eclipse MicroProfile

Raymond Augé
© Shutterstock / spainter_vfx

The release cycle for Java EE is quite long, so how can enterprises take advantage of recent trends like microservices? While Eclipse MicroProfile was designed to solve this issue, there are still some gaps. Raymond Augé explains how developers can build their own open source Eclipse MicroProfile with OSGi.

Interest in microservices has exploded in recent years. That’s because the idea of structuring an application as a series of loosely coupled services has the potential to greatly improve the development process of large, complex applications. Developers are able to split into teams to build their particular services with each team empowered to test and deploy features at their own pace.

From a business perspective, there’s nothing more frustrating than having to slow down the pace of releases because your code base has become too expansive and unwieldy. A microservices architecture has the potential to sidestep that problem.

The Java community has not been immune to the evangelization of microservices. However, the Java community – or at least the enterprise side of it – faces a unique challenge in the form of the Java EE release cycle. While Oracle has moved to increase the pace of Java SE and SDK releases to once every six months, new versions of Java EE have typically been released just once every few years. As a result, Java EE has not kept up with the trend towards microservices.

In an attempt to rectify the shortcomings in Java EE, Red Hat, IBM and others began the Eclipse MicroProfile (MP) initiative. Its explicit mission is to “optimize enterprise Java for a microservices architecture.” While this is a worthy goal, the lack of reference implementations poses a risk that enterprises get stuck with proprietary MP components, with all the accompanying challenges associated with vendor lock-in.

SEE ALSO: Building a resilient microservice? All you need is Eclipse MicroProfile Fault Tolerance!

The challenge is that most MP components don’t have a portable implementation that can be reused outside of a specific vendor’s stack. It’s true that several vendors build their MP components in open source. However, they are often far from portable.

The micro-ness of these proprietary implementations is in danger of getting quickly lost due to inevitable vendor extras getting piled onto the stack. Suddenly, you find yourself back in the monolith you tried so hard to escape from. Truly micro environments allow build time assembly using only the parts required by the application with no cruft sitting around collecting dust. Yet, in order for that to be possible, the implementations have to take portability into consideration.

Fortunately, there are open source alternatives being worked on. In particular, the Apache Geronimo project is working to provide a solution to the problem of portability. Geronimo’s creators describe the project as “an open source server runtime that integrates the best open source projects to create Java/OSGi server runtimes that meet the needs of enterprise developers and system administrators.” In other words, Geronimo allows enterprise developers to create the kind of portable, scalable applications that are by definition unreliant on a specific vendor’s stack.

While the Geronimo project had a long period of apparent dormancy, recent activities focused around MP (like here, here, here and here, just to name a few) have reinvigorated the project. It is particularly important that Geronimo’s implementations are intended for portability from the beginning and also have support for OSGi.

SEE ALSO: “Jigsaw won’t be important for consumers for quite a while — we already have Maven and OSGi”

It is also oddly coincidental that many MP components have close relatives specified in the OSGi R7 release. Configurator, Converter, JAX-RS Whiteboard, Promises, Push Streams, Cluster Information are but a few OSGi R7 specifications which tackle microservice related issues (see this list of highlights). Implementations of these specifications provided by the Apache Felix and Apache Aries projects have long provided the kind of cornerstone, open source, enterprise quality components required to assemble light, focused runtimes, delivering unprecedented power with just a tiny footprint.

In addition, the OSGi Alliance is working on a Contexts & Dependency Injection (CDI) Integration specification (based on CDI 2.0) that models the dynamics and true modularity of OSGi onto CDI. This is significant given the role that CDI plays in the MP design process. With it, developers will be empowered to stitch their own MP requirements together. Effectively, they are creating a custom “micro profile” of their own that contains only the bare essentials of the application in true microservice fashion. The reference implementation of the OSGi CDI Integration specification is hosted by Apache Aries (full disclosure, I am leading this specification and implementing the RI).

As a demonstration of the power of open source and OSGi, it will shortly be possible to build a base profile according to the MP 2.0 proposal using an OSGi R7 Framework, Aries CDI (OSGi CDI spec not yet final) and Aries JAX-RS (implements OSGi JAX-RS Whiteboard). Together, these provide the MP 2.0 base profile requirements which include CDI 2.0, Common Annotations 1.3, JAX-RS 2.1, JSON-B 1.0 and JSON-P 1.1 (if you’re comfortable using unreleased, bleeding edge code, you can assemble this today).

SEE ALSO: Eclipse MicroProfile: What it has to offer to the Java community

Other MP features are provided by Apache Geronimo implementations for MP-Config, MP-Fault Tolerance, MP-JWT Auth and MP-Open Tracing. Meanwhile, the cross-over resulting from a true OSGi/CDI integration generates several fantastic alternatives to MP components. Specifically, MP-Config is replaced by OSGi Configurator and OSGi Converter, MP-Fault Tolerance is replaced by OSGi Asynchronous Service, MP-Health Check is replaced by OSGi Rest Management, MP-Metrics is replaced by OSGi Cluster Information and MP-Rest Client is replaced by OSGi JAX-RS Whiteboard. This leaves only MP-Open API without an existing alternative, but hopefully with the power of open source this situation won’t last long.

In short, truly micro Eclipse MicroProfile capabilities are coming using open source and OSGi.


Raymond Augé

Raymond Augé is an avid proponent of open source software. He believes in open standards and open development. Raymond participates and contributes in several open source projects and is an Apache, Eclipse and bndtoolscommitter. His day job is a core developer on the open source Liferay Portal. Follow him on Twitter @rotty3000.

Leave a Reply

4 Comments on "Build your own open source Eclipse MicroProfile"

Notify of
Thomas Driessen

This article is very interesting, but I think the links to the recent activities around Apache Geronimo are broken :/ At least in my browser they are just text and not links.

Kind regards,

Eirini-Eleni Papadopoulou

Dear Thomas, thank you for your feedback.
We are sorry you have trouble opening the link.
However, the links do not appear broken to us. Maybe there is an issue with your browser?

Thomas Driessen

I used Chrome, Firefox and Edge and in none of them the links appeared as links. It is just text.
The paragraph I’m referring is: “While the Geronimo project had a long period of apparent dormancy, recent activities focused around MP (like here, here, here and here, just to name a few)”.
The “… like here, here, here and here …” links are just text in every browser I tried.

Eirini-Eleni Papadopoulou

Thomas, you were right. It turned out to be a technical issue and a couple of links were lost. It is now fixed. Please let us know if you still have trouble opening the links.

Thank you so much for bringing this to our attention.