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 ...

Get Learning Spring Boot 2.0 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.