This commit is contained in:
lxu75
2025-04-17 18:24:04 +08:00
parent 53557fabee
commit bfd5565b0f

View File

@@ -1,6 +1,7 @@
package com.volvo.ai.analytic.center.controller;
import com.alibaba.fastjson.JSONObject;
import com.volvo.common.core.util.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -28,8 +29,9 @@ public class TestController {
@PostMapping("/mockMq")
@ApiOperation(value = "补偿处理消息")
public ResultMsg<Object> mockMq(@RequestBody String topic,@RequestBody String message) {
rocketMQTemplate.syncSend(topic, message);
public ResultMsg<Object> mockMq(@RequestBody String message) {
JSONObject messageJson = JSONObject.parseObject(message);
rocketMQTemplate.syncSend(messageJson.getString("topic"), messageJson.getString("message"));
return ResultMsg.ok("ok");
}