rabbitmq参数异常
如果遇到此错误,有可能是客户端消费的时候未设置"x-message-ttl"参数,或设置的与服务器上的不一至导至的。
解决方法:
在服务器上查询参数值
配置rabbitmq时加入
@Bean(QUEUE_INFORM_LAMP)
public Queue QUEUE_INFORM_EMAIL(){
Map map=new HashMap<>();
map.put("x-message-ttl",300000);
return new Queue(QUEUE_INFORM_LAMP,true,false,false,map);
}
或者
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = "tiopic.queueq1",arguments = {@Argument(name = "x-message-ttl",value = "30000")}),
exchange = @Exchange(value = "topic", type = ExchangeTypes.TOPIC),
))