Demystifying Microservices for Java EE Developers
This talk by David Heffelfinger and Stephen Millidge gave a quick overview of what Microservices are, discussed if this can be done in Java EE, explained strategies how to migrate from a Monolith to Microservices, and then showed showed some demo applications (with MQTT). They also discussed the possible upcoming features in Java EE 9 (Or EE4J)
- The modern Java EE implementations is lightweight and small and can be embedded
- The programming model is familiar and easy to use
- You have an uber jar (fat jar) deployment model option
- Can run in docker, as fat jar or thin war.
With a Microservices Architecture comes the Fallacies of distributed computing. So it’s important to first check if you should be migrating to Microservices.
3 Options to migrate:
- Iterate refactoring
- Hybrid model
- Only new projects
Some features in Microprofile that assist with Microservices type applications:
- Configuration API
- Fault tolerance (timeout, bulkhead, circuit breaker)
- JWT Propagation
Some possible feature in upcoming releases:
- Project Jigsaw support
- New Event API
- NoSQL database support
- New State Management API
The small demo using MQTT to communicate between two services was only using 27MB Memory and 64 MB file size on disk.
It could handle more that 700 requests per second.
JSR 375: New Security APIs for Java EE
Ivar Grimstad took us through some more detail on the new Security API (as mentioned in previous post)
The goals of this new API:
- Simplify security programming model
- Enable developers to manage security
- Layered APIs delegate to others
- Use CDI where appropriate
All of this can be used in Servlet, JAX-RS, JSP, MVC and more
This is specifically done for Servlet.
Some new annotations:
@BasicAuthenticationMechanismDefinition @FormAuthenticationMechanismDefinition @CustomFormAuthenticationMechanismDefinition @LoginToContinue @RememberMe @AutoApplySession
This is an abstract over the user and group store. You can also write your own, and stores can be chained (with added priority)
Some new annotations:
@LdapIdentityStoreDefinition @DatabaseIdentityStoreDefinition // Also using the existing @RolesAllowed
Security Context (Caller)
Some resources to check out:
Connect Java EE to the Cloud with JCA
Stephen Millidge explained the demo that is also available in the Payara Booth. It’s basically Payara Micro Servers running on raspberry pies, talking to each other with MQTT and clustered CDI Events, connecting to Microsoft Azure IoT Hub with JCA (yes Sarel, they are using a 16 years old technology to connect to the cloud) Talking to a cluster of Payara Micros on Azure.
Very cool !! If you blow on the sensors you can see the graph on the Internet change due to the humidity.
“The Java EE Connector architecture defines a standard architecture for connecting the Java EE Platform to heterogeneous Enterprise informations Systems”
JDK 9 Language, Tooling, and Library Features
The whole presentation can be downloaded here:
Architecting for Failure: Why Are Distributed Systems Hard?
The he discussed the challenges the distributing computing brings, as we now can not rely on other systems to be available or responsive.
Lagom, an open source microservices framework built on Akka and Play, can assist with building these types of system.
Bring Your Favorite Kafka to Java EE with CDI
Ivan St. Ivanov discussed the Extensibility of CDI by talk through an example CDI Extension that connects to Kafka. This talk was less about Kafka and more about CDI Extentions.
We went through the CDI lifecycle and the options available to hook into this using SPI.
See the video here https://developer.oracle.com/videos
Java EE: Revolutionizing Design Pattern Use
Alex Theedom gave a really nice talk on how simple and easy design patterns is with the Java EE programming Model and we discussed and showcased the following patterns
MVC 1.0: Community Involvement Matters!
Oracle decided to not include the new Action based view technology (MVC 1.0) in the Java EE 8 Spec, and handed over to Ivar Grimstad who is now running with it.
The spec and implementation is basically feature complete.
This is very similar to Spring MVC and VRaptor, except that is’s now a standard and it’s built on JAX-RS and CDI.
How can we, the community, help ?
- Give feedback
- Create a Logotype
- LaTex -> AsciiDoc (the spec documentation)
MVC comes with JSP and facelets support out of the box, but there is already community contributed support for:
IBM Liberty Open sourcing
This is a full Java EE 7 and Microprofile server that is open source with no restrictions. This is very good news for us!
Then I made some new friends at #PartyOne2017 !!
With David Heffelfinger