Implementation

We will use RabbitMQ as the message broker. Ensure that you have installed and started up RabbitMQ before proceeding further.

Installation instructions for RabbitMQ are provided at https://www.rabbitmq.com/download.html.

The next step is to add connectivity to Spring Cloud Bus for Microservice A. Let's add the following dependency in the pom.xml file of Microservice A:

    <dependency>      <groupId>org.springframework.cloud</groupId>      <artifactId>spring-cloud-starter-bus-amqp</artifactId>    </dependency>

We can run Microservice A on different ports by providing the port as one of the startup VM arguments. The following screenshot shows how you can configure the server port as the VM argument in Eclipse. The value configured is -Dserver.port=8081 ...

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