transactions - SimpleMessageListenerContainer ChannelTransacted 和 MaxConcurrentConsumers

标签 transactions rabbitmq amqp spring-amqp

我正在尝试使用 Spring AMQP 配置 SimpleMessageListenerContainer 和 channel 事务,以根据需要动态添加消费者。问题是,当我有 channel 交易时,我没有看到消费者被动态添加。需要明确的是,这不会在负载下动态添加消费者:

container.setMaxConcurrentConsumers(5);
container.setChannelTransacted(true);
container.setTransactionManager(rabbitTransactionManager);

但这确实:

container.setMaxConcurrentConsumers(5);
//container.setChannelTransacted(true);
//container.setTransactionManager(rabbitTransactionManager);

我的问题是:

  1. 为什么不动态添加消费者?
  2. 是否有解决方法可以让 channel 交易和动态消费者同时发挥作用?

最佳答案

  1. 这是一个错误 - 请打开 JIRA issue .

  2. 不幸的是,没有解决方法;它需要一个补丁。

使用 RabbitMQ 进行事务处理的情况相当罕见,尤其是在消费者方面 - 您能解释一下为什么需要它们吗?

关于transactions - SimpleMessageListenerContainer ChannelTransacted 和 MaxConcurrentConsumers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30174436/

相关文章:

PhpAmqpLib : Uncaught exception 'ErrorException' with message 'fwrite(): send of 19 bytes failed with errno=104 Connection reset by peer'

Golang amqp 重新连接

message-queue - 在 FIFO 排队系统中,实现优先级消息传递的最佳方式是什么

java - 如何使用 RestTemplate 在 qpid 中创建队列?

node.js - 如何向除发布者之外的所有订阅者发送消息,发布者也是同一 rabbitMQ 队列上的监听器

mysql - 事务暂停在 MySQL 中如何工作?

MySQL 可重复读取和丢失更新/幻读

c# - 交易范围的细微差别

python - 禁用 'transaction' 包中的日志记录( Pyramid 应用程序)

python - 滑子岛和 Flask 之间没有路线