代码-清除老旧pom依赖
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.accompany.mq.listener;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.mq.model.BaseMqMessage;
|
||||
import com.google.gson.internal.$Gson$Types;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -38,7 +38,8 @@ public abstract class AbstractMessageListener<T extends BaseMqMessage> implement
|
||||
if (!message.startsWith(StrUtil.DELIM_START) || !message.endsWith(StrUtil.DELIM_END)) {
|
||||
return;
|
||||
}
|
||||
T mqMessage = JSONUtil.toBean(message, $Gson$Types.canonicalize(((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0]), true);
|
||||
T mqMessage = JSONObject.parseObject(message)
|
||||
.toJavaObject(((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0]);
|
||||
if (mqMessage == null) {
|
||||
return;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.accompany.mq.producer;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.accompany.mq.model.BaseMqMessage;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.client.producer.SendCallback;
|
||||
import org.apache.rocketmq.client.producer.SendResult;
|
||||
@@ -66,7 +66,7 @@ public class MQMessageProducer {
|
||||
// }
|
||||
// object.setMessId(messId);
|
||||
// object.setMessTime(System.currentTimeMillis());
|
||||
String objectJson = JSONUtil.toJsonStr(object);
|
||||
String objectJson = JSON.toJSONString(object);
|
||||
log.info("queueName : {}, message : {}", queueName, objectJson);
|
||||
rocketMQTemplate.asyncSend(queueName, MessageBuilder.withPayload(objectJson).build(), new SendCallback() {
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class MQMessageProducer {
|
||||
// }
|
||||
// object.setMessId(messId);
|
||||
// object.setMessTime(System.currentTimeMillis());
|
||||
String objectJson = JSONUtil.toJsonStr(object);
|
||||
String objectJson = JSON.toJSONString(object);
|
||||
log.info("queueName : {}, message : {}", queueName, objectJson);
|
||||
rocketMQTemplate.asyncSendOrderly(queueName, MessageBuilder.withPayload(objectJson).build(), hashKey, new SendCallback() {
|
||||
@Override
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.accompany</groupId>
|
||||
<artifactId>accompany-core-starter</artifactId>
|
||||
<artifactId>accompany-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
Reference in New Issue
Block a user