Running multiple instances

Availability for scaling up the number of microservice's instances is one of the main concepts around Spring Cloud Stream. However, there is no magic behind this idea. Running multiple instances of an application is very easy with Spring Cloud Stream. One of the reasons for this is native support from message brokers, which is designed to handle many consumers and huge amounts of traffic.

In our case, all the messaging microservices also expose the RESTful HTTP API, so first, we have to customize the server port per instance. We have performed such operations before. We may also consider setting two Spring Cloud Stream properties, spring.cloud.stream.instanceCount and spring.cloud.stream.instanceIndex. Thanks to ...

Get Mastering Spring Cloud 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.