Rabbit Spring Boot 属性 [英] Rabbit Spring Boot properties
问题描述
以下属性之间的主要区别是什么:
What is the key difference between the following properties :
1)spring.rabbitmq.listener.direct.prefetch= # 单个请求中要处理的消息数.它应该大于或等于交易大小(如果使用).
1)spring.rabbitmq.listener.direct.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used).
2)spring.rabbitmq.listener.simple.prefetch= # 单个请求中要处理的消息数.它应该大于或等于交易大小(如果使用).
2)spring.rabbitmq.listener.simple.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used).
推荐答案
使用 Spring AMQP 1.7.x 及更早版本(引导 1.5.x 使用该版本),只有一个侦听器容器(SimpleMessageListenerContainer
).
With Spring AMQP 1.7.x and earlier (boot 1.5.x uses that version), there was only one listener container (SimpleMessageListenerContainer
).
Spring AMQP 引入了一个新的监听器容器(DirectMessageListenerContainer
);因此,boot 现在有 2 组属性,具体取决于您选择的属性.
Spring AMQP introduced a new listener container (the DirectMessageListenerContainer
); boot therefore, now, has 2 sets of properties, depending on which property you choose.
实际上,...direct...
属性的帮助是不正确的,因为该容器不支持事务大小.
Actually, the help for the ...direct...
property is incorrect since that container does not support transaction size.
prefetch
表示每个消费者允许多少未确认的消息.简单容器的 transaction-size
表示在提交事务之前处理了多少消息;它还表示在发送 ack
之前处理了多少消息.
The prefetch
represents how many unacknowledged messages are allowed at each consumer. The simple container's transaction-size
represents how many messages are processed before a transaction is committed; it also represents how many messages are processed before an ack
is sent.
有关这些属性的更多信息,请参阅 Spring AMQP 文档.
See the Spring AMQP documentation for more information about these properties.
这篇关于Rabbit Spring Boot 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!