Helius
2021-09-25 d74032da9b0a6a893a8a03e3fa64d2f0ae2a9f2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cc.mrbird.febs.rabbit.consumer;
 
import cc.mrbird.febs.rabbit.constants.QueueConstants;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
 
/**
 * @author wzy
 * @date 2021-09-25
 **/
@Slf4j
@Component
public class AgentConsumer {
 
    @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT)
    public void agentReturn(Message message, Channel channel) {
        log.info("消费者:{}", new String(message.getBody()));
    }
}