|
|
@ -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)) {
|
|
|
|
// //记日志
|
|
|
|
// //记日志
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|