How to do it...

Let's build non-blocking and message-driven services using the following steps:

  1. 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, ...

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