From 5073a245f53fd5ca936e779be8c6b9b19d42f67d Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 11 七月 2024 09:47:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/main/java/com/ycl/jxkg/rabbitmq/product/Producer.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/rabbitmq/product/Producer.java b/src/main/java/com/ycl/jxkg/rabbitmq/product/Producer.java index eb1420d..aeabc0c 100644 --- a/src/main/java/com/ycl/jxkg/rabbitmq/product/Producer.java +++ b/src/main/java/com/ycl/jxkg/rabbitmq/product/Producer.java @@ -34,11 +34,16 @@ Message message = MessageBuilder.withBody(jsonMsg.getBytes()).andProperties(messageProperties).build(); // 璁剧疆娑堟伅鐨勫叧鑱旀暟鎹紝浠ヤ究鍙戦�佺‘璁ゅ洖璋冦�佹湭璺敱鎴愬姛娑堟伅鐨勫鐞� MyCorrelationData msgCorrelationData = new MyCorrelationData(examId + "", RabbitMqMsgTypeEnum.EXAM); - rabbitTemplate.convertAndSend("examExchange", "exam", message, msgCorrelationData); + rabbitTemplate.convertAndSend("jxkgExchange", "exam", message, msgCorrelationData); } - public void meetMsg(Integer examId, String jsonMsg, Long delayTime) { - rabbitTemplate.convertAndSend("examExchange","meet", "浣犲ソ锛孯abbitMQ"); + public void meetMsg(Integer meetId, String jsonMsg, Long delayTime) { + MessageProperties messageProperties = new MessageProperties(); + messageProperties.setExpiration(delayTime + ""); + Message message = MessageBuilder.withBody(jsonMsg.getBytes()).andProperties(messageProperties).build(); + // 璁剧疆娑堟伅鐨勫叧鑱旀暟鎹紝浠ヤ究鍙戦�佺‘璁ゅ洖璋冦�佹湭璺敱鎴愬姛娑堟伅鐨勫鐞� + MyCorrelationData msgCorrelationData = new MyCorrelationData(meetId + "", RabbitMqMsgTypeEnum.MEET); + rabbitTemplate.convertAndSend("jxkgExchange", "meet", message, msgCorrelationData); } } -- Gitblit v1.8.0