Crafting a REST Controller
Learn about Spring AMQP and how to create a Spring WebFlux REST controller.
We'll cover the following...
We'll cover the following...
Spring AMQP is dedicated to applying the “Spring way” to AMQP, a popular messaging protocol.
Adding AMQP dependency
The first step is to add Spring AMQP to our project’s build file:
Adding Spring AMQP to the project
Defining the Spring WebFlux REST controller
Next, we need to create a Spring WebFlux REST controller class to respond to those POST calls:
Configuring a reactive controller for AMQP messaging
Here’s a breakdown of the code above:
-
In line 1,
@RestControllersignals that this class focuses on consuming and rendering JSON payloads instead of rendering templates. -
In ...