package com.pannk.listener;

import com.pannk.entity.MessageEntity;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.pannk.cons.Constant.DIRECT_QUEUE;

/**
 * 直连消费
 *
 * @author wolf
 * @date 20-11-17
 */
//@Component
public class DirectRecevicer2Listener {


    @RabbitListener(queues = {DIRECT_QUEUE})
    @RabbitHandler
    public void process(MessageEntity messageEntity) {
        System.out.println("Other process id " + messageEntity.getId() + ", code " + messageEntity.getCode() + ", content " + messageEntity.getContent());
    }
}
