1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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());
    }
 
}