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()); } }