异常消息发送

master
赵嘉伟 3 years ago
parent 84b6d43cc4
commit 55afd862f7

@ -15,16 +15,16 @@ public class ActiveMQUtil {
@Autowired @Autowired
private JmsMessagingTemplate defaultJmsTemplate; private JmsMessagingTemplate mesJmsTemplate;
public void wechatSendMessage(String user, String text) { public void wechatSendMessage(String user, String text) {
String queue = "send.weChat.notice"; String queue = "send.weChat.notice";
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
try{ try{
jsonObject.put("TO_USER", "@all"); jsonObject.put("TO_USER", user);
jsonObject.put("CONTENT",text); jsonObject.put("CONTENT",text);
// defaultJmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(3)); // defaultJmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(3));
defaultJmsTemplate.convertAndSend(queue, jsonObject.toString()); mesJmsTemplate.convertAndSend(queue, jsonObject.toString());
// if (StringUtil.isBlank(message)) { // if (StringUtil.isBlank(message)) {
// //记日志 // //记日志
// } // }

Loading…
Cancel
Save