|
@@ -0,0 +1,43 @@
|
|
|
+package com.fdkankan.manage.mq.consumer;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.rabbitmq.client.Channel;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.amqp.core.Message;
|
|
|
+import org.springframework.amqp.rabbit.annotation.Queue;
|
|
|
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 场景封存解封 mq
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@Component
|
|
|
+public class LaserSceneGpsConsumer {
|
|
|
+
|
|
|
+
|
|
|
+ @RabbitListener(
|
|
|
+ queuesToDeclare = @Queue("${queue.laser.update-scene.location:save-scene-location}")
|
|
|
+ )
|
|
|
+ public void consumerQueue(Channel channel, Message message) {
|
|
|
+ try {
|
|
|
+ String messageId = message.getMessageProperties().getMessageId();
|
|
|
+ String msg = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
+ log.info("laser-update-save-scene-location-mq--messageId:{},msg:{}",messageId,msg);
|
|
|
+
|
|
|
+ channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
|
+
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("laser-save-scene-location------消费失败",e);
|
|
|
+ }finally {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|