Here’s a short overview of the process I recommend. I’ve also written a longer article that describes the process in much more detail.
Step 1: Wrap your monolith as a module using OSGi (or JPMS if you prefer)
Most Java monoliths can easily be wrapped as a single OSGi or JPMS module. You’re simply adding a bit of metadata to the project. Most frameworks (including Spring) will run just fine.
Step 2: Use fine-grained refactoring practices to extract your microservice
Leveraging modular tooling such as the Eclipse Plug-in Development Environment or BndTools, your development team gradually extracts microservices from a monolith using fine-grained refactoring techniques not possible with standard tooling.
Your code always compiles, your tests always pass, your changes are always integrated.
Step 3: Deploy as often as you like while refactoring
During deployment we discard (or ignore) the modular metadata and tools. The evolving microservice is simply packaged as a separate JAR available to the monolith class loader.
Fine-grained refactoring allows you to practice true continuous delivery, and deploy to an environment you’re already familiar with.
You can even toggle between refactoring and new feature development. There’s no need to hold off adding new features during the process.
Step 4: Deploy your microservice remotely
When your microservice has been fully extracted, then it’s time to deploy it remotely.
Separating your microservice refactoring from the complexity of remote deployment allows you to focus on one thing at a time and better manage your risk.
If you’re interested in learning more about this approach or in discussing how it might be applied in your projects, why not schedule a free remote consultation and demo?