Spring AMQP multi-threaded producer

左心房为你撑大大i 提交于 2020-01-05 05:46:06

问题


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.



来源:https://stackoverflow.com/questions/53742710/spring-amqp-multi-threaded-producer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!