I add the dead letter queue in my project, this is my config example:
@Configuration
public class HappyBombQueueConfig {
/**
*
*
* @return
*/
@Bean
public Queue happybombReportQueue() {
return QueueBuilder.durable(BizGlobalConstant.HAPPY_BOMB_REPORT_MESSAGE_QUEUE_NAME)
.withArgument("x-dead-letter-exchange",BizGlobalConstant.DL_EXCHANGE)
.withArgument("x-dead-letter-routing-key", BizGlobalConstant.DEAD_QUEUE)
.build();
}
}
when I start the project, shows this error:
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'wallet.consume.report' in vhost 'report': received the value 'dl.exchange' of type 'longstr' but current is none, class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:288) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:138) ~[amqp-client-5.4.3.jar!/:5.4.3]
... 32 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'wallet.consume.report' in vhost 'report': received the value 'dl.exchange' of type 'longstr' but current is none, class-id=50, method-id=10)
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:516) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:178) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:111) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:670) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48) ~[amqp-client-5.4.3.jar!/:5.4.3]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:597) ~[amqp-client-5.4.3.jar!/:5.4.3]
... 1 common frames omitted
Because this is my production env, and now have message in the RabbitMQ, I can not delete the old queue to recreate a new one. is it possible not delete the queue wallet.consume.report
to fix the problem?
question from:
https://stackoverflow.com/questions/65843559/received-the-value-dl-exchange-of-type-longstr-but-current-is-none-when-star 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…