|
@@ -25,10 +25,18 @@ public class RocketMQSender {
|
|
|
@Value("${rocketmq.producer.send-message-timeout:3000}")
|
|
@Value("${rocketmq.producer.send-message-timeout:3000}")
|
|
|
private Long messageTimeOut;
|
|
private Long messageTimeOut;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @Author: xujunwei
|
|
|
|
|
+ * @Description: 次方法适用于 消费者配置监听所有tag,在消费实现时候可以获取tag
|
|
|
|
|
+ */
|
|
|
public void sendMsg(String topic,String tag,Object body) {
|
|
public void sendMsg(String topic,String tag,Object body) {
|
|
|
rocketMQTemplate.syncSend(topic+":"+tag,body,messageTimeOut);
|
|
rocketMQTemplate.syncSend(topic+":"+tag,body,messageTimeOut);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @Author: xujunwei
|
|
|
|
|
+ * @Description: 次方法适用于 消费者配置消费特定的tag,在消费实现中无法获取tag
|
|
|
|
|
+ */
|
|
|
public void sendMsg(String topic,MessageBody<Object> body) {
|
|
public void sendMsg(String topic,MessageBody<Object> body) {
|
|
|
rocketMQTemplate.syncSend(topic+":"+body.getTag(),body,messageTimeOut);
|
|
rocketMQTemplate.syncSend(topic+":"+body.getTag(),body,messageTimeOut);
|
|
|
}
|
|
}
|