提交 | 用户 | 时间
|
191b3d
|
1 |
package com.iailab.module.data.mq.consumer; |
H |
2 |
|
|
3 |
import org.springframework.amqp.rabbit.annotation.*; |
|
4 |
import org.springframework.stereotype.Component; |
|
5 |
|
|
6 |
import java.util.Date; |
|
7 |
|
|
8 |
/** |
|
9 |
* @author Houzhongjian |
|
10 |
* @Description |
|
11 |
* @createTime 2024年11月05日 |
|
12 |
*/ |
|
13 |
@Component |
21dc7e
|
14 |
@RabbitListener(queues = ImageMessage.DAHUA_ROUTING_KEY) |
H |
15 |
@RabbitListener(queues = ImageMessage.HIKVISION_ROUTING_KEY) |
191b3d
|
16 |
public class ImageConsumer { |
H |
17 |
|
|
18 |
// @RabbitHandler |
|
19 |
public void process(ImageMessage imageMessage) throws InterruptedException { |
21dc7e
|
20 |
System.out.println("测试消费摄像头截图RabbitMQ消息----------------------"); |
191b3d
|
21 |
Thread.sleep(5000); |
H |
22 |
System.out.println(imageMessage.toString()); |
|
23 |
System.out.println(new Date()); |
|
24 |
System.out.println(imageMessage.getCreateTime()); |
|
25 |
System.out.println(imageMessage.getMessageId()); |
|
26 |
System.out.println(imageMessage.getImageDTO().getImagePath()); |
|
27 |
} |
|
28 |
|
|
29 |
} |