Let's build non-blocking and message-driven services using the following steps:
- Let's first modify consumer of the message or the source of the response transaction, which is the Login Microservice. Add a @Configuration class that will create two queues, namely the request and reply queues. This class will be responsible for creating and binding a new routing key, packt.async, which is used for asynchronous messaging:
@Configuration @EnableWebFlux @EnableRabbit public class RabbitMQConfigAsync { @Autowired private DirectExchange exchange; @Bean public Queue requestQueue() { return new Queue("msg.request"); } @Bean public Queue replyQueue() { return new Queue("msg.reply"); } @Bean public Binding binding(DirectExchange exchange, ...