Spring AMQP multi-threaded producer

2019-07-29 17:59发布

问题:

I have a multi-threaded application that uses a RabbitTemplate (with CachingConnectionFactory) to send messages to the broker. I need to ensure that the messages are delivered in order. I have seen this answer about this myself in: Spring AMQP ensuring message order in multi-threaded environment

Are these the only two options with Spring AMQP? What does a dedicated connection mean? I need to define a new RabbitTemplate with its ConnectionFactory in each java class that serves as the producer?

Thank you!

回答1:

Versions 2.0 and later now support scoped operations where all operations within the scope of the invoke occur on the same channel.

Of course "in order" can only mean in order within each thread.



标签: spring-amqp