Java EE Micro Profile – Optimizing Java EE for microservices


Take your skills to the next level!

The Persistence Hub is the place to be for every Java developer. It gives you access to all my premium video courses, monthly Java Persistence News, monthly coding problems, and regular expert sessions.


There are a lot of complaints about the lacking progress on Java EE 8 and that the standard doesn’t address modern challenges and trends. But I don’t want to argue about that … at least in not in this post.

Today, I want to talk about something huge that happened at the DevNation 2016 keynote. Red Hat, IBM, Payara, Tomitribe and LJC announced a Micro Profile for Java EE with the goal to optimize Java EE for microservice architectures. This announcement not only shows that most of the big players in the application server market are working on optimized solutions for microservice architectures but also that they are still committed to Java EE and its future.

What is a profile?

Before we dive into the details of the new Micro Profile, let me explain what a profile is.

Profiles were added in Java EE 6 with the goal to define subsets of Java EE specifications for specific purposes. So far, there are only 2 profiles, the full profile, which contains all Java EE specifications and the smaller web profile, which defines a subset of specifications for web applications.

Up to now, the Micro Profile is not part of the Java EE specification and therefore not an official profile. But that will change when the profile definition gains some stability.

What’s part of the Micro Profile?

The first version of the Micro Profile only includes CDI, JAX-RS, which uses the Servlet specification, and JSon-P. This is obviously the bare minimum of Java EE specifications required to implement a microservice which uses a REST API to exposes resources as JSON documents.
If you prefer to use XML instead of JSON, you can, of course, use JAX-B, which is part of Java SE and doesn’t require any additional Java EE specification.

What might get added in the future?

The current version of the Micro Profile includes only a small number of specifications and several ones might be added in the future. You can provide feedback on which specifications you like to have in the Micro Profile on microprofile.io.

I’m not involved in the definition of the profile, but these are the specifications I expect to be added in the future:

  • The most obvious one is the Bean Validation specification which is used by most applications to validate the JSON input.
  • The Java EE Security API (which is probably the OAuth 2 option in the survey) as the new Java EE security standard.
  • The JTA specification to provide transaction support within a microservice.

What’s missing?

There are a lot of things that could be added to the profile, but if you want to keep it small, you need to focus on the most common use cases. For these, I’m missing 3 things in the current Micro Profile:

  1. input validation – this might be added via the Bean Validation specification soon,
  2. configuration – there is no configuration standard in Java EE so far, but Apache Tamaya would be a good solution, and this could be the first step to establishing a standard,
  3. metrics – monitoring key metrics is another important task that’s not covered by a Java EE standard.

As you see, 2 out of these 3 are currently not covered by a Java EE specification, and it’s, therefore questionable if and when they can be added to the Micro Profile.

How to participate?

First of all, you should take 2 minutes and answer the surveys about the standards you like to add to the Micro Profile and about your most important aspects of microservices on microprofile.io.

And if you want to take a more activate approach and join the discussions, you can do that in the MicroProfile google group.

References

Video recording of the DevNation key note (currently broken)

Announcements by Red Hat, Payara, IBM, Tomitribe

MicroProfile.io

MicroProfile FAQ

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.