|
|
@@ -1,14 +1,16 @@
|
|
|
package com.fdkankan.task.config;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.fdkankan.task.common.MqConstants;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.amqp.core.Message;
|
|
|
import org.springframework.amqp.core.MessageProperties;
|
|
|
+import org.springframework.amqp.rabbit.connection.CorrelationData;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* @author liuqi
|
|
|
@@ -25,18 +27,30 @@ public class SendMessage {
|
|
|
@Resource(name = "v3RabbitTemplate")
|
|
|
private RabbitTemplate secondRabbitTemplate;
|
|
|
|
|
|
- public void sendTov2Message(JSONObject jsonObject) {
|
|
|
- MessageProperties messageProperties = new MessageProperties();
|
|
|
- messageProperties.setContentType("application/json");
|
|
|
- Message info = new Message(jsonObject.toString().getBytes(), messageProperties);
|
|
|
- v2RabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v2, info);
|
|
|
+ public void sendTov2Message(Object jsonObject) {
|
|
|
+ String messageId = UUID.randomUUID().toString();
|
|
|
+ log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, MqConstants.RABBITMQ_QUEUE_v3, jsonObject);
|
|
|
+ secondRabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v2, jsonObject, message -> {
|
|
|
+ message.getMessageProperties().setMessageId(messageId);
|
|
|
+ message.getMessageProperties().setContentType("application/json");
|
|
|
+ return message;
|
|
|
+ }, new CorrelationData(messageId));
|
|
|
}
|
|
|
|
|
|
- public void sendTov3Message(JSONObject jsonObject) {
|
|
|
- MessageProperties messageProperties = new MessageProperties();
|
|
|
- messageProperties.setContentType("application/json");
|
|
|
- Message info = new Message(jsonObject.toString().getBytes(), messageProperties);
|
|
|
- secondRabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v3, info);
|
|
|
+ public void sendTov3Message(Object jsonObject) {
|
|
|
+ String messageId = UUID.randomUUID().toString();
|
|
|
+ log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, MqConstants.RABBITMQ_QUEUE_v3, jsonObject);
|
|
|
+ secondRabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v3, jsonObject, message -> {
|
|
|
+ message.getMessageProperties().setMessageId(messageId);
|
|
|
+ message.getMessageProperties().setContentType("text/plain");
|
|
|
+ return message;
|
|
|
+ }, new CorrelationData(messageId));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//4898cab059bd_202403021541083950:;/home/ubuntu/data/4898cab059bd_202403021541083950:;068b90ca4/1214153168250732544/4898cab059bd_202403021541083950/:;:;zfb-bwm88wy0S:;0:;17712966965:;11:;slam:;1214153168250732544:;068B90CA4:;0:;V3
|
|
|
+//THETAYP41138901.OSC_20240304085626:;/home/ubuntu/data/THETAYP41138901.OSC_20240304085626:;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/THETAYP41138901.OSC_20240304085626:;THETAYP41138901.OSC_20240304085626.Zip:;zfb-6msEqaPMI:;0:;thetayp41138901.osc:;6:;slam:;:;THETAYP41138901.OSC:;0:;V3
|
|
|
+//063632f34_202403031853520160:;/home/ubuntu/data/063632f34_202403031853520160:;063632f34/1213925351923646464/063632f34_202403031853520160/:;:;zfb-77bQlrH7I:;0:;13950265761:;11:;slam:;1213925351923646464:;063632F34:;0:;V3
|
|
|
+//5838794f2858_202402291421199920:;/home/ubuntu/data/5838794f2858_202402291421199920:;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f2858_202402291421199920:;5838794f2858_202402291421199920.zip:;zfb-Fx1R2jcEE:;0:;THETAYP41147092.OSC:;6:;slam:;:;THETAYP41147092.OSC:;0:;V3
|
|
|
+//5838794f2858_202403021437486990:;/home/ubuntu/data/5838794f2858_202403021437486990:;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f2858_202403021437486990:;5838794f2858_202403021437486990.zip:;zfb-gT3twAGWi:;0:;THETAYP41147092.OSC:;6:;slam:;:;THETAYP41147092.OSC:;0:;V3
|
|
|
+//THETAYP41142254.OSC_20240303123647:;/home/ubuntu/data/THETAYP41142254.OSC_20240303123647:;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/THETAYP41142254.OSC_20240303123647:;THETAYP41142254.OSC_20240303123647.Zip:;zfb-qOCODnKYE:;0:;thetayp41142254.osc:;6:;slam:;:;THETAYP41142254.OSC:;0:;V3
|