package com.iailab.module.data.mq.consumer; import org.springframework.amqp.rabbit.annotation.*; import org.springframework.stereotype.Component; import java.util.Date; /** * @author Houzhongjian * @Description * @createTime 2024å¹´11月05æ—¥ */ @Component @RabbitListener(queues = ImageMessage.DAHUA_ROUTING_KEY) @RabbitListener(queues = ImageMessage.HIKVISION_ROUTING_KEY) public class ImageConsumer { // @RabbitHandler public void process(ImageMessage imageMessage) throws InterruptedException { System.out.println("测试消费摄åƒå¤´æˆªå›¾RabbitMQ消æ¯----------------------"); Thread.sleep(5000); System.out.println(imageMessage.toString()); System.out.println(new Date()); System.out.println(imageMessage.getCreateTime()); System.out.println(imageMessage.getMessageId()); System.out.println(imageMessage.getImageDTO().getImagePath()); } }