package spring.boot;

import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
import org.springframework.stereotype.Component;

/**
 * @author ameryhan
 * @date 2019/8/29 14:05
 */
@Component
public class MsgReceiver implements ChannelAwareMessageListener {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    @RabbitHandler
    @RabbitListener(queues = RabbitConfig.QUEUE_A, containerFactory = "rabbitListenerContainerFactory")
    public void onMessage(Message message, Channel channel) throws Exception {
        logger.info("接收处理队列A当中的消息： " + message);
        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    }
}

@@ -885,24 +885,114 @@
 + message);%0A
+        //List%3CString%3E list = new ArrayList%3C%3E();%0A        //list.get(3).equals(%22hanzhan%22);%0A
         chan

add rabbit mq