O'Reilly logo

Learning Spring Boot 2.0 - Second Edition by Greg L. Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calling one microservice from another with client-side load balancing

Remember how we configured our Eureka Server earlier to run on a separate port? Every microservice has to run on a distinct port. If we assume the images service is our frontend (it has the Thymeleaf template, and is closest to consumers for serving up image data), then we can let it continue to run on Netty's default port of 8080.

That leaves one decision: what port to run the comments service on? Let's add this to the comments service's application.yml:

    server: 
      port: 9000 

This setting instructs Spring Boot to run comments on port 9000. With that in place, let's go back to images, and make some adjustments.

For starters (Spring Boot starters), we need to add some extra ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required