Berlin Brown
Berlin Brown

Reputation: 11734

Launching multiple spring boot instances but one hostname for local development

If I want to launch 10 spring boot instances, I guess on multiple ports or running on the same JVM. How do I accomplish a system such that one client will connect to the same host but could possibly hit multiple spring boot services. Normally I launch one REST controller/service under one JVM and one spring boot instance with one host and port. How do I accomplish multiple instances with multiple controllers

Upvotes: 1

Views: 5091

Answers (2)

Akhil
Akhil

Reputation: 1264

As @Darren and @MohamedSanaulla suggested you can use service discovery (Eureka) and Api gateway (Zuul) to achieve what you want, basically Eureka is a service discovery which keeps track of all the services registered to it on the other hand Zuul act api gateway to forward all your request to the designated service, also Zuul internally uses Ribbon, so you don't have to worry about client side load-balancing and at end you can deploy all services in docker containers and manage them using docker swarm to scale up/down without any hassle. A working example of Eureka, Zuul using docker and docker-compose can be found here.

Upvotes: 3

MohamedSanaulla
MohamedSanaulla

Reputation: 6242

You can do client side load balancing using Netflix Ribbon. There is a spring guide here

Upvotes: 0

Related Questions