RabbitMQ synchronous message processing with asynchronous two queue

73 Views Asked by At

Using RabbitMQ with Java Spring, is it possible to perform a synchronous wait to ensure that a message sent to the first queue is added to the second queue after being processed by an external service and then the result from the second queue is received and used via the same thread?enter image description here

1

There are 1 best solutions below

0
Artem Bilan On

The @RabbitListner is able to receive and reply with support of @SendTo: https://docs.spring.io/spring-amqp/reference/amqp/receiving-messages/async-annotation-driven/reply.html

The RabbitTempalte has an API like sendAndReceive() to perform request-reply synchronous operations: https://docs.spring.io/spring-amqp/reference/amqp/request-reply.html

So, let's see if that helps you somehow!