且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring AMQP 确保多线程环境中的消息顺序

更新时间:2021-10-29 04:47:15

您必须为每个发布者使用专用连接(因此:连接工厂).

You would have to use a dedicated connection (hence: connection factory) for each publisher.

或者,您可以使用 RabbitTemplate.execute() 并使用回调中提供的通道来发布所有消息.

Or, you could use RabbitTemplate.execute() and use the channel provided in the callback to publish al messages.