HUHANK commented on issue #472: URL: https://github.com/apache/rocketmq-client-cpp/issues/472#issuecomment-2144453572
这个是测试代码: ``` void test1() { try { DefaultMQProducer producer("A-Hank-TEST_GROUP_P"); producer.setNamesrvAddr("192.168.28.235:9876"); producer.setInstanceName("A-Hank-TEST_GROUP_P_INS"); producer.setSendMsgTimeout(1000); producer.setRetryTimes(6); producer.setRetryTimes4Async(6); producer.start(); // MQMessageQueue mQueue; // mQueue.setTopic("Hank-Test"); // mQueue.setQueueId(0); // mQueue.setBrokerName("broker-b"); for(int i=0; i<1000; i++) { MQMessage msg("Hank-Test", "", "", "Hello RocketMQ " + to_string(i)); producer.send(msg); // producer.sendOneway(msg, mQueue); cout << "Send: " << i << endl; this_thread::sleep_for(500ms); } producer.shutdown(); } catch (exception &ex) { cout << "ERROR: " << ex.what() << endl; } } ``` 服务器设置延迟的命令: `tc qdisc add dev ens192 root netem delay 3000ms` rocketmq服务和producer程序分别部署在不同的服务器上; -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org