|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
|
|
|
import sun.rmi.runtime.Log;
|
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
@@ -42,15 +43,17 @@ public class OrderDownConsumer {
|
|
|
queuesToDeclare = @Queue("${queue.orderPay.order-payResult:order-payResult}")
|
|
|
)
|
|
|
public void consumerQueue(Channel channel, Message message) {
|
|
|
- log.info("order-payResult----开始消费");
|
|
|
try {
|
|
|
String messageId = message.getMessageProperties().getMessageId();
|
|
|
- String msg = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
+ String msg = Arrays.toString(message.getBody());
|
|
|
log.info("接受下单结果mq--messageId:{},msg:{}",messageId,msg);
|
|
|
|
|
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
|
+ msg = msg.substring(1, msg.length() - 1);
|
|
|
+
|
|
|
msg = StringEscapeUtils.unescapeJava(msg);
|
|
|
- PayOrderVo order = JSONObject.parseObject(JSONObject.toJSONString(msg), PayOrderVo.class);
|
|
|
+
|
|
|
+ PayOrderVo order = JSONObject.parseObject(msg, PayOrderVo.class);
|
|
|
if(order == null){
|
|
|
return;
|
|
|
}
|
|
@@ -78,4 +81,5 @@ public class OrderDownConsumer {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|