首页>代码>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); } }

qinzhifang LV1
3月15日
笛卡尔积 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日