Reputation: 12416
We are slowly migrating our tomcat application to microservices, meaning that we need several tomcat applications at once. This is easy in kubernetes cluster, but not easy to achieve in development environment.
We are using IntelliJ Idea and it would be the easiest to be able to run once tomcat instance and deploy all applications to it. This seems to be a problem as Idea runs into java.net.BindException: Address already in use (Bind failed)
as it is trying to bind to ports which were bound in other microservice running.
What is the best practice to do these things? How to run several instances without having to run several tomcats on different ports?
Upvotes: 2
Views: 2633
Reputation: 4456
When developing microservices, it should not matter where (on which port) the applications run. I run my microservices (based on spring-boot) locally on different ports with a development profile/config.
Both locally and in production our microservices talk to each other using a message broker like ActiveMQ. This way it doesn't matter on which port they run.
So my advice would be: just run them on different ports and make sure they don't depend on the ports using a service registry.
If you add more details about your setup and applications perhaps we can give you a more detailed answer on how to accomplish it.
Upvotes: 3