首页>代码>springboot集成rabbitmq生产者消费者模型>/springboot-rabbitmq/src/main/java/com/simon/springbootrabbitmq/consumer/MsgReceiver.java
package com.simon.springbootrabbitmq.consumer;

import com.simon.springbootrabbitmq.config.RabbitMqConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Simon
 */
@Slf4j
@Component
public class MsgReceiver {

    @RabbitHandler
    @RabbitListener(queues = RabbitMqConfig.QUEUE_KEY)
    public void process(String msg) {
        log.info("消费者接收消息 : " + msg);
    }

}
最近下载更多
最代码官方  LV167 2023年2月26日
最近浏览更多
笛卡尔积  LV6 2023年9月25日
duon12  LV1 2023年9月25日
gaoxin222  LV14 2023年6月16日
1529860026  LV24 2023年6月1日
3054069007  LV1 2023年5月29日
陆程江  LV2 2023年5月29日
北。  LV6 2023年4月28日
master_guo  LV7 2023年4月12日
做你的景天  LV7 2023年3月30日
走你個魯  LV21 2023年3月27日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友