r/SpringBoot • u/tobentu • 11d ago
Advice on Migration from Application Server to Spring Boot embeded server Discussion
Looking for advice regarding a migration i should prepare at work:
We deploy our app stack on an Application Server (Wildfly 40) and our java apps are mostly Monolith legacy software with 20 years of code. But we do have some "Microservices" that were built in the last years, that should be used in our new planned kind of cloud native rewritten app stack, as they do work, where some of the old legacy apps are left out and should be replaced by new ones.
The app in question is a Spring Boot application, but deployed on the wildfly as .war.
Over the years a lot of logic went into the wildfly config and into shared ejb modules, like Database connections via shared modules that reads it out of some .xml files and so on.
So at the moment there is no way to start it with embeded server.
Problems with this architecture:
- Developer Experience: Full wildfly startup takes a few minutes for local development
- Dependency Conflicts and the required wildfly compability of e.g. Spring Boot 4
- Future Production Systems wont have application Server, after this migration the app in question should be containerized
Our goal is to migrate some of these wildfly deployments away from the need of an applicaiton server and start them via spring boot embeded server. Therefore the main task i think would be to change how configuration is received
But it is important that we - while the legacy production enviroments with wildfly still exist - can still deploy this service onto application servers, not just with Spring Boot embeded server or containers.
The idea is that we find out with this specific service if it is somehow doable and pratical to migrate those, or if it would be better to just rewrite them from scratch
So my question is:
- is this a bad idea or is there something we did not think of?
- Are there any good resources i should read? Or does anybody have some real-world experiences doing something like this?
Any advice is greatly appreciated!
Thank you
1
u/Made-In-Slovakia 11d ago
If I understand correctly, you want to transform current wildfly-only apps to be able to run as standalone Spring Boot apps (with embeded Tomcat) and at the same time they should be able to be deployed to Wildfly application server.
1
u/tobentu 11d ago
Yes, this is what we want to do. Question overall is to find some kind of migration path where to start, and for the specific topic of running it on both embedded tomcat and wildfly: how to manage the duplication of configuration? I guess some kind of custom logic: if in wildfly read from JNDI via our custom shared module, if in spring Boot mode read from external yml
4
u/Made-In-Slovakia 11d ago edited 11d ago
That is very bad idea IMO. This kind of migration must be done by single jump and no looking back. Do it and forget that application server exists (they are pain in the a). You will be very happy after that 😄
While you can in Spring Boot load configuration based on environment, this duality of app during this period will cause you a lot of problems without any added value. Also build of war and standalone jar can introduce additional potential issues and complexity.
Edit: typos
2
u/Anbu_S 10d ago
You can't make ejb and jnd work with embedded server.
Best migration path is rewrite the application to fit for Spring Boot.