无法从应用程序yml为Spring云流应用程序创建优先级队列

问题描述

我正在创建一个用于SCDF流的spring cloud stream应用程序。我正在尝试从应用程序属性设置使用者绑定的max-priority属性。但是创建的队列不是优先级队列。 如果在创建流时将maxPriority用作部署程序属性,则可以创建优先级队列。

我在Yaml中使用的设置如下:-

spring:
  cloud: 
    stream: 
      rabbit: 
        bindings: 
          input:
            consumer:
              maxPriority: 10

我正在使用2.1.3版本的Spring Cloud Rabbit活页夹

不能使用应用程序yml文件设置此属性吗?流中有很多应用程序,通过部署程序属性传递此属性非常麻烦。

解决方法

我刚刚复制了您的YAML,对我来说效果很好

enter image description here

spring:
  cloud: 
    stream: 
      rabbit: 
        bindings: 
          input:
            consumer:
              maxPriority: 10
      bindings:
        input:
          group: foo

通过部署程序为您工作的事实令人怀疑;运行时代码忽略了属性的实际设置方式。因此,由于某些原因,您的YAML未被使用。

编辑

它也适用于配置服务器。

http:// localhost:8080 / actuator / env

enter image description here

enter image description here

编辑

使用匿名消费者:

enter image description here

enter image description here