以下属性之间的主要区别是什么:
1)spring.rabbitmq.listener.direct.prefetch= #单次请求处理的消息数。它应该大于或等于事务大小(如果使用)。
2)spring.rabbitmq.listener.simple.prefetch= #单次请求处理的消息数。它应该大于或等于事务大小(如果使用)。
发布于 2018-09-21 08:37:28
在Spring AMQP1.7.x和更早的版本(boot1.5.x使用该版本)中,只有一个侦听器容器(SimpleMessageListenerContainer)。
Spring AMQP引入了一个新的侦听器容器( DirectMessageListenerContainer);因此,boot现在有两组属性,具体取决于您选择的属性。
实际上,...direct...属性的帮助是不正确的,因为该容器不支持事务大小。
prefetch表示每个使用者允许多少未确认的消息。简单容器的transaction-size表示在提交事务之前处理了多少消息;它还表示在发送ack之前处理了多少消息。
参见the Spring AMQP documentation for more information about these properties。
发布于 2018-09-21 07:25:37
看起来这些属性适用于旧版本的spring boot当我使用特定于版本https://docs.spring.io/spring-boot/docs/1.5.3.RELEASE/reference/html/common-application-properties.html的文档时,只有这个属性可用: spring.rabbitmq.listener.prefetch= #单个请求中要处理的消息数量。它应该大于或等于事务大小(如果使用)。
https://stackoverflow.com/questions/52434549
复制相似问题