From the course: Spring Boot 2.0 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Spring message consumers

Spring message consumers

From the course: Spring Boot 2.0 Essential Training

Start my 1-month free trial

Spring message consumers

- [Instructor] We'll start our journey of async messaging by creating a consumer and getting Rabbit up and running. So the first thing we need to do is get Rabbit up and running. And in the bin directory, once again, I have set a startup script that you can use. So let's do this start_rabbit. Again, this applies to bash-based systems. So now that Rabbit's up and running, let's go to our IDE. Let's open up the pom file and our room cleaner app, and let's add a dependency, and this one is going to be spring-boot-starter-amqp. That comes from org.springframework. We will import that. Now let's go to src, main, java, and our base package, and let's create a new package, and we will simply call this async. Now, in that package, let's create a new Java class. This one is going to be called AsyncPayload. It's going to have two attributes, so an id and a model. Let's put getters and setters on there. Excellent. Now let's…

Contents