我正在构建一个spring-cloud应用程序,并使用stream来管理我的rabbitmq优先级队列。但是application.yml中的maxPriority设置不起作用。
下面是我的配置:
spring:
cloud:
stream:
rabbit:
bindings:
highLevelOutput:
producer:
maxPriority: 10
highLevelInput:
consumer:
maxPriority: 10
bindings:
highLevelOutput:
destination: notification-high
contentType: application/x-java-object;type=com.txn.notification.entity.NotificationMessage
highLevelInput:
group: high
producer:
requiredGroups: high
destination: notification-high
contentType: application/x-java-object;type=com.txn.notification.entity.NotificationMessage
contentType: application/x-java-object;type=com.txn.notification.entity.NotificationMessage我注意到在流的RabbitConsumerProperties类中没有任何与优先级配置相关的内容,这个属性是从其他地方读取的吗?
发布于 2017-06-22 20:16:10
我刚刚测试了它,它对我来说工作得很好。

请注意,队列不能已经存在-您不能更改现有队列的最大优先级。在这种情况下,它将被忽略。
您使用的是什么版本?该属性位于RabbitConsumerProperties的超类RabbitCommonProperties中。
它只适用于生产者,如果它有所需的组,因为它是一个队列属性,生产者不直接处理队列。
https://stackoverflow.com/questions/44698764
复制相似问题