MassTransit3 消息转发
MassTransit3 message forwarding
我有一个消息使用者 (IConsumer<>
),其作用类似于消息路由器。要路由消息,我使用 context.Forward()
方法。但是转发本身并没有发生。 RabbitClient 抛出:
RabbitMQ.Client.Exceptions.OperationInterruptedException**: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'auto_delete' for exchange 'query1' in vhost 'Gateways': received 'false' but current is 'true'", classId=40, methodId=10, cause=
是的,我正在尝试将消息转发到使用 auto_delete=true
标志创建的队列。我如何将消息转发到此类端点?
要转发到 auto-delete 交换,您需要在将查询字符串传递给 GetSendEndpoint
方法之前向其添加一些额外的参数。
rabbitmq://server/exchange_name?autodelete=true
你不能直接转发到队列,所以应该不需要durable=true
,但是如果你继续报错,你也可以添加&durable=true
来解决它。
我有一个消息使用者 (IConsumer<>
),其作用类似于消息路由器。要路由消息,我使用 context.Forward()
方法。但是转发本身并没有发生。 RabbitClient 抛出:
RabbitMQ.Client.Exceptions.OperationInterruptedException**: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'auto_delete' for exchange 'query1' in vhost 'Gateways': received 'false' but current is 'true'", classId=40, methodId=10, cause=
是的,我正在尝试将消息转发到使用 auto_delete=true
标志创建的队列。我如何将消息转发到此类端点?
要转发到 auto-delete 交换,您需要在将查询字符串传递给 GetSendEndpoint
方法之前向其添加一些额外的参数。
rabbitmq://server/exchange_name?autodelete=true
你不能直接转发到队列,所以应该不需要durable=true
,但是如果你继续报错,你也可以添加&durable=true
来解决它。