package com.iailab.module.shasteel.mq.consumer; import com.iailab.module.shasteel.mq.config.QueuePredictFinishConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component; /** * @author PanZhibao * @Description * @createTime 2024年12月11日 */ @Slf4j @Component public class ModelPredictFinishConsumer { @RabbitListener(queues = QueuePredictFinishConfig.QUEUE_NAME) public void listen(Message message) { String routingKey = message.getMessageProperties().getReceivedRoutingKey(); log.info("routingKey:" + routingKey); String messageBody = new String(message.getBody()); log.info("messageBody:" + messageBody); } }