问题描述
在使用RocketMQ的可视化工具dashboard-1.0.0时,首先生产了10条数据,但是查询时却查出来了14条,有四条数据重复,重复数据MessageID和key相同,但是通过key单独查询却只能查出一条
测试代码
package com.fdw.rocketmq.producer;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;
public class OneWayProducer {
public static void main(String[] args) throws MQClientException, RemotingException, InterruptedException {
int messageCount = 10;
DefaultMQProducer producer = new DefaultMQProducer("pg");
producer.setNamesrvAddr("127.0.0.1:9876");
// 设置发送超时时限为5s,默认3s
producer.setSendMsgTimeout(5000);