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
@RabbitListener(queues = {DIRECT_QUEUE})
public class DirectReceiveListener {


    @RabbitHandler
    public void handler(MessageEntity messageEntity) {
        System.out.println("Receive message  " + messageEntity.getId() + "," + messageEntity.getCode() + "," + messageEntity.getContent());
    }

}
