The project was conducted in two phases:
- Moving the application as-is into Pivotal Cloud Foundry ("Lift-and-Shift")
- Then carving out the first microservices ("Re-Platforming")
The Lift-and-Shift phase focused on deploying the application to PCF. Deployment, monitoring and logging would be done using standard PCF tools. The team prepared the application for a cloud environment deployment. Configuration parameters were extracted into YML files and delivered via Spring Cloud Services; this kept the needs of the environment separate from the needs of the application. A deployment pipeline was built using Jenkins to deploy the application to a test environment, run the automated tests, and then deploy to a staging environment. Both environments were sites in the PCF space. Direct dependencies (JAR files) were replaced with delegate classes (using an Apache CXF) that would subsume SOAP XML calls to the underlying services.
The Re-Platforming phase focused on identifying candidates for carve-out, setting patterns and practices around the development of microservices, and deploying the first instance of the hybrid solution.
When figuring out which functionalities to carve out, the best approach was to identify existing coarse-grained boundaries. These functionalities were easier to separate and put into a service, as they had a clearly defined seam that could be replaced with REST calls to an external service.
Two new microservices (account and customer, both existing modules) subsumed existing SOAP XML calls to underlying services (using delegate classes and Apache CXF), while exposing a REST API to be consumed by the application. The API and data models were kept simple, providing only the needed functionality. This was a key refactoring opportunity; the complexity of the underlying system could not simply be re-built in a different implementation.