Java EE application modernization with OpenShift

Get the code

Summary

This code pattern shows how to modernize a Java EE application by transforming it into Kubernetes-based microservices. It demonstrates steps to create a container image of a fictional healthcare company’s patient-facing application and deploy it to a Red Hat OpenShift on IBM Cloud™ cluster.

Description

Imagine an example healthcare or health insurance company that has been around for many years. It has hundreds of thousands of patient records in a SQL database connected to either a mainframe or a monolithic Java application structure. Our sample application patient records look very similar to the health records of most insurance companies.

The company recently decided to modernize its patient-facing application and break it up into microservices. The team decided to move to a SQL database connected to a Java Platform, Enterprise Edition (Java EE) application running on Open Liberty for the business logic, and a Node.js application for the patient user interface. In addition, the company also decided to bring these applications to the cloud.

When you use this code pattern, you understand how to transform a traditional Java application into microservices on the cloud.

Flow

Java EE app modernization with OpenShift architecture flow diagram

  1. The user makes a call to one of the APIs for the Java EE application, which is behind the OpenShift application load balancer.
  2. The load balancer routes the call to the Open Liberty container running in a Kubernetes pod.
  3. The Java EE application queries the MySQL database running in the cloud to get the desired data.
  4. The MySQL database sends back the data to the Java EE application, where it is handled accordingly.
  5. The data is converted into JavaScript Object Notation (JSON) format, which is returned to the API and the user.

Instructions

Ready to give it a try? Find detailed technical steps for this code pattern in the README.md file in the GitHub repository.

  1. Create a Red Hat OpenShift on IBM Cloud cluster.
  2. Provision a Compose for MySQL database.
  3. Create a Docker container image of a Java EE application.
  4. Push the container image to a Docker Hub repository.
  5. Change the image key in the kubernetes-openshift.yaml file.
  6. Edit the secret values for your MySQL cloud deployment.
  7. Set database access parameters for an Open Liberty server.
  8. Deploy the application to the Red Hat OpenShift on IBM Cloud cluster.
  9. Expose the application to the internet.
  10. Populate the MySQL database with synthetic patient health records.