Adding Spring AMQP in our pom.xml

Let's add the spring-amqp jars to our project. spring-amqp has a starter dependency which configures some common things for us, such as ConnectionFactory and RabbitTemplate, so we will use that. To add this dependency, we will configure our pom.xml follows:

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

The next step is to configure the connections; we will use the application.yaml file because we are using the starter. In the next section, we will do the configuration.

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