This sample demonstrates how to modernize 10+ year-old Java EE applications with cloud-native technologies and the modern Java runtimes Quarkus and Open Liberty. The modernized application is deployed to and operated with OpenShift, the enterprise distribution of Kubernetes.
- Demonstrated Capabilities, Technologies and Tools
- Introduction Video (12 mins)
- Session Recording: Application Modernization and Rabbits (30 mins)
- Architecture
- Documentation
- Deployment via Docker Desktop
- Deployment to OpenShift on IBM Cloud with Tekton
- Deployment to OpenShift on IBM Cloud with Tekton and ArgoCD
- Deployment to OpenShift on IBM Cloud with local Scripts
- More Deployment Options
Application modernization is a journey. The legacy application has been modernized in ten steps.
- Monolith - WebSphere Traditional 8.5.5
- Java EE 6 app from 2008 with Db2 database running in VMs or bare metal.
- Monolith - WebSphere Traditional 9 in container
- Application converted with Transformation Advisor.
- Monolith - WebSphere Liberty
- Application converted with Eclipse Migration Tools.
- Separated frontend
- Dojo frontend in separate container.
- Monolith - Open Liberty
- Modern project structure.
- Strangled Catalog Service and remaining Open Liberty Monolith
- Strangled catalog service (inspired by Mono2Micro) developed with Quarkus and Postgres.
- Event driven architecture via Kafka.
- Strangled Catalog Service and remaining Quarkus Monolith
- Strangled Quarkus catalog service uses reactive programming model.
- Remaining Quarkus monolith runs as native executable.
- Micro frontend based web application
- Developed with single-spa and Vue.js. Messaging is done via RxJS.
- CI/CD via Tekton
- Target OpenShift. Via OpenShift Pipelines operator.
- CI/CD via Tekton and ArgoCD
- Target OpenShift. Via OpenShift GitOps operator.
The following 12 minutes video describes the project on a high level:
Architecture of the legacy application:
Screenshot of legacy storefront application:
Architecture of the modernized application:
Screenshot of modernized storefront application:
I've written a series of blogs about this project:
- Project Overview Video (12 mins)
- Project Teaser Video (2 mins)
- Rabbit video: Application Modernization and Rabbits
- Recording from WeAreDevelopers: Application Modernization and Rabbits (30 mins)
- Project Overview Slides
- 10 Reasons why Enterprises should modernize Applications
- Improving operational Efficiency through Application Modernization
- Modernizing Java EE Applications with WebSphere Liberty
- Step-by-Step Instructions how to use Transformation Advisor
- Modernizing Applications with new User Experiences
- Moving from WebSphere Liberty to Open Source with Open Liberty
- Increasing Productivity for legacy Liberty Applications
- Don’t build distributed Monoliths!
- Strangler Pattern Example
- Step-by-Step Instructions for Mono2Micro
- Event driven Architectures for loosely coupled Microservices
- Using Quarkus for building reactive Applications
- Using Micro Frontends in Microservices based Architectures
- Developing Micro Frontends with Single-Spa
- Developing loosely coupled Micro Frontends via RxJS
- Deploying Db2 on OpenShift
- Deploying Postgres on OpenShift
- Deploying Kafka on OpenShift
- OpenShift Logging Quick Start
- Running Liberty Applications with Db2 locally
- Running legacy Java Applications locally
- Application Modernization Resources on IBM Developer
- IBM Garage Application Modernization Playbook
Over the next weeks I've planned to write these blogs:
- Deployments of Apps to OpenShift via Source
- Exernalizing Configurations for OpenShift Deployments
- Deploying Nginx on OpenShift
- Using CORS for OpenShift Applications
- Deployments to OpenShift via local Scripts
- Deploying Tekton on OpenShift
- Sample Tekton Pipelines for Microservices
- Debugging Tekton on OpenShift
- Using Git in Tekton Tasks on OpenShift
- Deploying ArgoCD on OpenShift
- Using GitOps on OpenShift
If you want to run the modernized application locally, you can invoke the following commands. All you need is a local Docker installation and the git CLI.
Notes:
- Docker requires 14 GB memory, 10 CPUs and 80 GB disk space
- It takes roughly 15 - 20 minutes to start everything
- Make sure docker-compose is also installed (sounds like this needs to be installed separately on some systems)
$ git clone https://github.com/nheidloff/application-modernization-javaee-quarkus.git && cd application-modernization-javaee-quarkus
$ ROOT_FOLDER=$(pwd)
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run.sh
The 'build-and-run.sh' script will launch the following containers.
Once everything has been started, you can open the web applications:
- Legacy Dojo frontend: http://localhost/CustomerOrderServicesWeb
- Modern micro-frontend based application: http://localhost:8080
Add the item "Return of the Jedi" to the shopping cart via drag and drop.
Update the price of this item:
$ curl -X PUT "http://localhost/CustomerOrderServicesWeb/jaxrs/Product/1" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"id\":1, \"price\":50}"
Open the "Order History" tab to see the updated price. The new price has been updated in the catalog service and the remaining monolith.
The following scripts deploy the modernized application on Red Hat OpenShift on IBM Cloud. However the same instructions should work for other OpenShift and OCP deployments, for example CodeReady Containers.
First create an IBM Cloud Account. Then create an OpenShift cluster, for example via the IBM Cloud Dashboard. I've tested classic infrastructure, single zone, OpenShift 4.6.17, b3c.8x32 and 3 worker nodes.
Additionally you need to install Tekton. The easiest option is to use the 'OpenShift Pipelines' operator from the OperatorHub view in the OpenShift Console (screenshots). Simply accept all defaults. No local installations are necessary.
$ git clone https://github.com/nheidloff/application-modernization-javaee-quarkus.git && cd application-modernization-javaee-quarkus
$ ROOT_FOLDER=$(pwd)
$ sh ${ROOT_FOLDER}/scripts-openshift-tekton/check-prerequisites.sh
$ oc login ...
$ sh ${ROOT_FOLDER}/scripts-openshift/deploy-db2.sh
$ sh ${ROOT_FOLDER}/scripts-openshift/deploy-kafka.sh
$ sh ${ROOT_FOLDER}/scripts-openshift/deploy-postgres.sh
$ sh ${ROOT_FOLDER}/scripts-openshift-tekton/deploy-application.sh
$ sh ${ROOT_FOLDER}/scripts-openshift-tekton/show-urls.sh