siltalau
siltalau

Reputation: 549

Spring AMQP: AsyncRabbitTemplate multiple instances

Is it possible to use the AsyncRabbitTemplate in a multi instance environment?

In my case, the instance that sends the request might not be the one handling the response. AsyncRabbitTemplate keeps track of sent messages in a ConcurrentHashMap so I'm wondering if the consumer only consumes messages that it has a reference to.

If this is an entirely wrong approach, can you point me in the right direction?

Upvotes: 0

Views: 316

Answers (1)

Gary Russell
Gary Russell

Reputation: 174484

You can have multiple instances but the replies have to go back to the sending instance (they can't use the same reply queue).

If a late (or unknown) reply is received, it is logged and discarded.

Upvotes: 1

Related Questions