channel is already closed due to clean channel shutdown

ERROR (ForgivingExceptionHandler.java:119) - Consumer com.whgtxx.exam.portal.listener.ScoreMarkerListener$1@125c29d8 (amq.ctag-PGSfYADMSk5inqPjY8sI_g) method handleDelivery for channel AMQChannel(amqp://whgexam@192.168.1.107:5672/,1) threw an exception for channel AMQChannel(amqp://whgexam@192.168.1.107:5672/,1)
com.rabbitmq.client.AlreadyClosedException: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=Closed due to exception from Consumer (amq.ctag-PGSfYADMSk5inqPjY8sI_g) method handleDelivery for channel AMQChannel(amqp://whgexam@192.168.1.107:5672/,1), class-id=0, method-id=0)

 

在调试rabbitmq时出现如上错误,经查是

 DefaultConsumer consumer=new DefaultConsumer(channel) {
                @Override
                public void handleDelivery(String consumerTag,
                                           Envelope envelope,
                                           AMQP.BasicProperties properties,
                                           byte[] body)
                    throws IOException
                {
                   // 业务处理逻辑

                  。。。。。
                    channel.basicAck(deliveryTag, false);
                }
    
            };

consumer的handle中的业务处理逻辑代码中存在异常抛出,导致channel.basicAck不能执行,而引发后续处理中的这个报错

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值