Eclipse Microprofile and Microservice Frameworks

My first experience of Enterprise Java was in 2001, this was pre-J2EE, (let alone JEE) picking up a tutorial binder explaining Servlets, JNDI, Enterprise Javabeans — when CORBA was used to generate the IDL’s, JMS. We didn’t really have a lot of guidance on it and it was pretty new at the time, but that said it was a big learning curve and it went ok. I went on to build several distributed systems on this technology over the next few years.

Overview

15 years later Eclipse MicroProfile was launched in 2016, after Java and Enterprise Java had hit a bit of a wall in terms of advancing the technology. Eclipse MicroProfile is an attempt to repackage the essential API’s in order to build microservice style architectures. We’re going to have a brief rundown of each of these API’s, what they provide and an example.

  • JSON-B — For processing JSON documents via newer style Java objects;
  • JSON-P — For processing JSON documents (older style).
  • Config — retrieval of application configuration properties by various means;
  • Fault Tolerancehandling failure (with downstream services, third party services) by using Circuit Breakers, Bulkheads etc…
  • Health — For building simple health checks into your services;
  • Metrics — For emitting performance metrics from your services (think performance information etc…)
  • JWT Auth— for building JSON web-token auth style flows into your services;
  • OpenAPI— for exposing your service RESTful API’s to the world for consumption — hurrah.
  • OpenTracing — distributed tracing for your services (a must if you're doing micro-services);
  • REST Client — Annotation driven REST endpoints, example.
  • Context and Dependency Injection (CDI) — Interceptors for cross-cutting concerns (auditing etc…) and observers for event style management.
  • Common Annotations Annotations for resources, lifecycle management.

Working Example

There’s a great overview here of an example of using MicroProfile to build microservices:

Comparisons

Eclipse MicroProfile isn’t the only way to build microservices in Java. You have a few other options as well:

Choosing

The choice of which microservice framework comes down to a number of factors for me (aside from building something to satisfy business requirements):

  • How easily the team can pick it up and work with it — the documentation and the tutorials (not just written by the core team either);
  • How good the support is when you run into issues with it and how they respond to your support requests;
  • How frequently it’s updated — I want to see active development on it.

In Conclusion

I’m a consulting CTO working with various languages and technology, but also Java. You can find out more about me here:

Consulting CTO (Interim/Fractional) — https://www.hwintegral.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store