Application modernization is done in multiple steps. This sample demonstrates how to modernize 12+ years old Java EE applications with cloud-native technologies like Quarkus and Open Liberty.
- Monolith - WebSphere ND or Traditional 8.5.5
- Starting point: Java EE 6 app from 2008 running in VM or bare metal
- Db2 is used as data store
- Monolith - WebSphere Traditional 9 in container
- Application converted with Transformation Advisor without code changes
- Monolith - WebSphere Liberty (latest)
- Application converted with Eclipse Migration Tools (and Transformation Advisor)
- Same project structure and EJBs
- Separated Frontend - WebSphere Liberty (latest)
- Dojo frontend in separate container
- Backend and frontend connected via proxy
- Separated Frontend - Open Liberty (latest)
- Still same project structure and EJBs
- Strangled Catalog Service and remaining Open Liberty Monolith
- Strangled catalog service
- Inspired by Mono2Micro
- Developed with Quarkus
- Runs in JVM
- Data is accessed in Postgres via Panache
- Kafka events are sent when prices change
- Remaining Open Liberty monolith
- Modern project structure and CDI
- Receives Kafka events when prices change and caches data
- Strangled catalog service
- Strangled Catalog Service and remaining Quarkus Monolith
- Strangled Quarkus catalog service
- Reactive endpoints and Postgres access
- Remaining Quarkus monolith
- Synchronous code
- Runs as native executable
- Strangled Quarkus catalog service
- Micro frontend based web application
- Developed with single-spa and Vue.js
- Split in six containers
- Messaging done via RxJS
- Material design
Screenshot of legacy storefront application:
Screenshot of modernized storefront application:
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 12 GB memory and 8 CPUs
- It takes roughly 15 - 20 minutes to start everything
$ 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.
I've written a series of blogs about this project:
- Application Modernization and Rabbits
- 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
- Workshop: Modernizing IBM WebSphere Applications
- Running Liberty Applications with Db2 locally
- Running legacy Java Applications locally
- Application Modernization Resources on IBM Developer
$ 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-monolith-db2.sh
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-monolith-app.sh
Open http://localhost/CustomerOrderServicesWeb
$ 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-monolith-db2.sh
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-splitted-frontend.sh
Open http://localhost/CustomerOrderServicesWeb
$ 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-monolith-db2.sh
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-splitted-frontend-open.sh
Open http://localhost/CustomerOrderServicesWeb
$ 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-monolith-db2.sh
$ sh ${ROOT_FOLDER}/scripts-docker/run-database-postgres-catalog.sh
$ sh ${ROOT_FOLDER}/scripts-docker/run-kafka.sh
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-catalog.sh
Open http://localhost/CustomerOrderServicesWeb
Add the item "Return of the Jedi" to the shopping cart and update the price.
Local Development - Catalog
Change the Postgres and Kafka URLs in application.properties. Plus change KAFKA_ADVERTISED_LISTENERS in docker-compose-kafka.yml.
$ cd catalog
$ mvn quarkus:dev
Local Development - Open Liberty (CDI)
Change the Kafka URL in microprofile-config.properties. Change database host and driver location in server.xml.
$ cd monolith-open-liberty-cloud-native
$ mvn liberty:dev
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-monolith-db2.sh
$ sh ${ROOT_FOLDER}/scripts-docker/run-database-postgres-catalog.sh
$ sh ${ROOT_FOLDER}/scripts-docker/run-kafka.sh
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-all-quarkus.sh
Open http://localhost/CustomerOrderServicesWeb
Add the item "Return of the Jedi" to the shopping cart and update the price.
In addition to the previous commands run this command:
$ sh ${ROOT_FOLDER}/scripts-docker/build-and-run-single-spa.sh
The following scripts launch the application in a container. However the application doesn't connect to the database yet.
$ sh scripts/install-dojo.sh
$ sh scripts/install-was-dependencies.sh
$ sh scripts-docker/build-and-run-monolith-app-was90.sh
Open https://localhost:9443/CustomerOrderServicesWeb/ (user: skywalker, password: force)
Open https://localhost:9043/ibm/console/login.do?action=secure (user: wsadmin, password: passw0rd)
The original version runs on bare metal (or in a virtual machine). Check the original documentation for setup instructions.
To simplify the setup, a container is used instead. Since the code in 'monolith-websphere-855' and 'monolith-websphere-90' is identical, similar commands as above can be executed:
$ sh scripts/install-dojo.sh
$ sh scripts/install-was-dependencies.sh
$ sh scripts-docker/build-and-run-monolith-app-was855.sh
Open https://localhost:9443/CustomerOrderServicesWeb/ (user: skywalker, password: force)
Open https://localhost:9043/ibm/console/login.do?action=secure (user: wsadmin, password: passw0rd)