|
@@ -30,44 +30,44 @@ import java.util.Map;
|
|
@Component
|
|
@Component
|
|
public class RabbitMqListener {
|
|
public class RabbitMqListener {
|
|
|
|
|
|
- @Value("${queue.modeling.extend.tower.data-push}")
|
|
|
|
- private String queueName;
|
|
|
|
- @Autowired
|
|
|
|
- private ITowerService towerService;
|
|
|
|
- @Autowired
|
|
|
|
- private RedisUtil redisUtil;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 铁塔项目数据推送监听器
|
|
|
|
- * @param channel
|
|
|
|
- * @param message
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- @RabbitListener(
|
|
|
|
- queuesToDeclare = @Queue("${queue.modeling.extend.tower.data-push}")
|
|
|
|
- )
|
|
|
|
- public void transferTourVideo(Channel channel, Message message) throws Exception {
|
|
|
|
- String key = "tower:scene:data:download";
|
|
|
|
- String messageId = message.getMessageProperties().getMessageId();
|
|
|
|
- String num = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
|
- log.info("开始消费消息,id:{},queue:{},content:{}", messageId, queueName, num);
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
- try {
|
|
|
|
- String zipPath = towerService.packSceneDataHandler(num);
|
|
|
|
- // TODO: 2023/6/20 推送到铁塔
|
|
|
|
-
|
|
|
|
- map.put("status", CommonSuccessStatus.SUCCESS.code());
|
|
|
|
- map.put("zipPath", zipPath);
|
|
|
|
- redisUtil.hset(key, num, JSON.toJSONString(map));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- map.put("status", CommonSuccessStatus.FAIL.code());
|
|
|
|
- map.put("error", ExceptionUtil.stacktraceToString(e, 3000));
|
|
|
|
- redisUtil.hset(key, num, JSON.toJSONString(map));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
|
|
- log.info("结束消费消息,id:{}", messageId);
|
|
|
|
- }
|
|
|
|
|
|
+// @Value("${queue.modeling.extend.tower.data-push}")
|
|
|
|
+// private String queueName;
|
|
|
|
+// @Autowired
|
|
|
|
+// private ITowerService towerService;
|
|
|
|
+// @Autowired
|
|
|
|
+// private RedisUtil redisUtil;
|
|
|
|
+//
|
|
|
|
+// /**
|
|
|
|
+// * 铁塔项目数据推送监听器
|
|
|
|
+// * @param channel
|
|
|
|
+// * @param message
|
|
|
|
+// * @throws Exception
|
|
|
|
+// */
|
|
|
|
+// @RabbitListener(
|
|
|
|
+// queuesToDeclare = @Queue("${queue.modeling.extend.tower.data-push}")
|
|
|
|
+// )
|
|
|
|
+// public void transferTourVideo(Channel channel, Message message) throws Exception {
|
|
|
|
+// String key = "tower:scene:data:download";
|
|
|
|
+// String messageId = message.getMessageProperties().getMessageId();
|
|
|
|
+// String num = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
|
+// log.info("开始消费消息,id:{},queue:{},content:{}", messageId, queueName, num);
|
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
|
+// try {
|
|
|
|
+// String zipPath = towerService.packSceneDataHandler(num);
|
|
|
|
+// // TODO: 2023/6/20 推送到铁塔
|
|
|
|
+//
|
|
|
|
+// map.put("status", CommonSuccessStatus.SUCCESS.code());
|
|
|
|
+// map.put("zipPath", zipPath);
|
|
|
|
+// redisUtil.hset(key, num, JSON.toJSONString(map));
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// map.put("status", CommonSuccessStatus.FAIL.code());
|
|
|
|
+// map.put("error", ExceptionUtil.stacktraceToString(e, 3000));
|
|
|
|
+// redisUtil.hset(key, num, JSON.toJSONString(map));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
|
|
+// log.info("结束消费消息,id:{}", messageId);
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|