Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java rabbitmq绑定器中的自定义DLX选项_Java_Spring_Spring Cloud_Spring Cloud Stream - Fatal编程技术网

Java rabbitmq绑定器中的自定义DLX选项

Java rabbitmq绑定器中的自定义DLX选项,java,spring,spring-cloud,spring-cloud-stream,Java,Spring,Spring Cloud,Spring Cloud Stream,我使用SpringCloudStream在微服务之间进行通信。我在rabbit mq代理中有以下预定义设置 "first" -> exchange of type Topic which is bound to Queue (name="user.create",x-dead-letter-exchange="first.dlx") "first.dlx" -> dead letter exchange of type Topic 和以下配置文件: spring: clou

我使用SpringCloudStream在微服务之间进行通信。我在rabbit mq代理中有以下预定义设置

"first" -> exchange of type Topic which is bound to Queue (name="user.create",x-dead-letter-exchange="first.dlx")
"first.dlx" -> dead letter exchange of type Topic
和以下配置文件:

spring:
    cloud:
        stream:
            bindings:
                consumer-input:
                  group: user.create
                  destination: first
                  contentType: application/json
                  binder: rabbit
            binders:
                rabbit:
                  type: rabbit
            rabbit:
                bindings:
                  consumer-input:
                    consumer:
                      acknowledgeMode: manual
                      declareExchange: false
                      queueNameGroupOnly: true 
                      bindQueue: false
                      deadLetterExchange: first.dlx
                      autoBindDlq: true
                      deadLetterRoutingKey: user.create.dlq
当我启动应用程序时,会说:

[AMQP Connection 127.0.0.1:5672] ERROR o.s.a.r.c.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'first.dlx' in vhost '/': received 'direct' but current is 'topic', class-id=40, method-id=10)
[AMQP连接127.0.0.1:5672]错误o.s.a.r.c.CachingConnectionFactory-通道关闭:通道错误;协议方法:#方法(回复代码=406,回复文本=Premission_失败-vhost'/'中exchange'first.dlx'的参数'type'不相等:收到'direct',但当前为'topic',类id=40,方法id=10)
因为rabbit mq试图声明类型为“direct”的dlx。这是网站的链接

所以我的问题是。。。有没有办法告诉rabbit mq声明除属性名“deadLetterExchangeType:topic”之类的“direct”类型之外的其他类型的dlx?或者根本不声明dlx


任何其他建议都会很有帮助

目前无法定义DLX exchange类型或阻止其声明。请打开一张支票

仅允许指定类型可能不够,因为它可能有其他不兼容的参数。我们可能应该添加
declareDlx
,类似于
declareeexchange