Now that we have given a brief introduction to microservices, we are ready to see an example microservices application written using Java EE. Our example application should be very familiar to most Java EE developers. It is a simple CRUD (Create, Read, Update, Delete) application. Developed as a series of microservices, the application will follow the familiar MVC design pattern, with the "View" and "Controller" developed as microservices. The application will also utilize the very common DAO pattern, with our DAO developed as a microservice as well.
We will be using Payara Micro to deploy our example code. Payara Micro is a lightweight Java EE application server derived from GlassFish, it is open source and freely available, and supports the Java EE web profile, which includes a subset of all Java EE specifications, namely, Security, Bean Validation, CDI, EJB Lite (provides a subset of full EJB functionality), the Unified Expression Language, JAX-RS, JDBC, JNDI, JPA, JSF, JSON-P, JSP, Servlets, and WebSockets.
Our application will be developed as three modules: first, a microservices client, followed by a microservices implementation of a controller in the MVC design pattern, then an implementation of the DAO design pattern implemented as a microservice.