Browse Source

测试mq消息

dev_shibei_match
jianjun 4 years ago
parent
commit
f4df2b1748
  1. 21
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestPController.java

21
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestPController.java

@ -18,11 +18,13 @@
package com.epmet.modules.group.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -76,5 +78,24 @@ public class TestPController {
return new Result().ok(result);
}
@RequestMapping("test-mq")
public Result testMqMsg(@RequestParam String content){
MqBaseMsgDTO msg = null;
if (StringUtils.isBlank(content)){
content = "{\"appId\":\"202007161443499985fa2d397436d10356542134c8f008c48\",\"eventClass\":\"resi_group\",\"eventTag\":\"shift_topic_to_issue\",\"msg\":\"[{\\\"actionFlag\\\":\\\"plus\\\",\\\"agencyId\\\":\\\"e9b55911549fe7b0d0427b557f7c5efc\\\",\\\"customerId\\\":\\\"45687aa479955f9d06204d415238f7cc\\\",\\\"eventClass\\\":\\\"resi_group\\\",\\\"eventTag\\\":\\\"topic_to_issue\\\",\\\"gridId\\\":\\\"708a3567b54ced7219666489f9d838ab\\\",\\\"groupId\\\":\\\"6838a625e4ccc0dc036f9903af833ad9\\\",\\\"isCommon\\\":false,\\\"remark\\\":\\\"小组成就3小组中发布的话题\\\\\\\"还是不行这里在测试测试测试为什么发反反复复反反复复反反复复方法不够爽肤水的分身乏术分身乏术发烧反反复复方法分为玩儿玩儿玩儿啦啦啦啦\\\\\\\"被转为议题\\\",\\\"sourceId\\\":\\\"67a06a217ecf46cd92944040323e70e0\\\",\\\"sourceType\\\":\\\"issue\\\",\\\"userId\\\":\\\"74b5d6792d89fb2fb2d0363de3cbc1aa\\\"},{\\\"actionFlag\\\":\\\"plus\\\",\\\"agencyId\\\":\\\"e9b55911549fe7b0d0427b557f7c5efc\\\",\\\"customerId\\\":\\\"45687aa479955f9d06204d415238f7cc\\\",\\\"eventTag\\\":\\\"shift_topic_to_issue\\\",\\\"gridId\\\":\\\"708a3567b54ced7219666489f9d838ab\\\",\\\"groupId\\\":\\\"6838a625e4ccc0dc036f9903af833ad9\\\",\\\"isCommon\\\":false,\\\"remark\\\":\\\"将话题\\\\\\\"还是不行\\\\\\\"转为议题\\\",\\\"sourceId\\\":\\\"67a06a217ecf46cd92944040323e70e0\\\",\\\"sourceType\\\":\\\"issue\\\",\\\"userId\\\":\\\"74b5d6792d89fb2fb2d0363de3cbc1aa\\\"}]\",\"requestUrl\":\"https://epmet-dev.elinkservice.cn/estos/producerService/producer/sendMsg\",\"token\":\"52d9d9b0e7d0eb5b8b81c205b579e07c\"}";
msg = JSON.parseObject(content,MqBaseMsgDTO.class);
}else{
msg = new MqBaseMsgDTO();
msg.setMsg(content);
msg.setEventClass("resi_group");
msg.setEventTag("shift_topic_to_issue");
}
Result<String> stringResult = SendMqMsgUtils.sendMsg(msg);
System.out.println("=========="+JSON.toJSONString(stringResult));
return stringResult;
}
}

Loading…
Cancel
Save