package org.jeecg.modules.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RabbitListener(queuesToDeclare = @Queue("hello"))
public class Receiver {
    /**
     * 通过@RabbitHandler声明的方法，对hello队列中的消息进行处理
     */
    @RabbitHandler
    public void receiver(String str) {
        log.info("Receiver says:[" + str + "]");
    }
}
