赞
踩
channel是非线程安全的 。
修改后的写法:
@RabbitListener(queues = “${data.queue}”,concurrency = “#{data.concurrency}”)
public void receiveData(SmsMsg message,@Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
}
产生重复的写法:
public void receiveData(SmsMsg message,@Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag, Channel channel) {
channel.basicAck(deliveryTag, false);//消息确认
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。