You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by du...@apache.org on 2022/06/04 08:10:33 UTC
[rocketmq] branch develop updated: Something in docs may cause confusion (#4403)
This is an automated email from the ASF dual-hosted git repository.
duhengforever pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 0fca6df7f Something in docs may cause confusion (#4403)
0fca6df7f is described below
commit 0fca6df7f4553e28e9ae668a903a3af9b5becbf6
Author: Dios314 <45...@users.noreply.github.com>
AuthorDate: Sat Jun 4 16:10:16 2022 +0800
Something in docs may cause confusion (#4403)
---
docs/cn/RocketMQ_Example.md | 4 ++++
docs/en/Example_Delay.md | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/docs/cn/RocketMQ_Example.md b/docs/cn/RocketMQ_Example.md
index 1b8ae05cb..f0e70bb51 100644
--- a/docs/cn/RocketMQ_Example.md
+++ b/docs/cn/RocketMQ_Example.md
@@ -440,6 +440,8 @@ public class ScheduledMessageConsumer {
public static void main(String[] args) throws Exception {
// 实例化消费者
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("ExampleConsumer");
+ // 设置NameServer的地址
+ consumer.setNamesrvAddr("localhost:9876");
// 订阅Topics
consumer.subscribe("TestTopic", "*");
// 注册消息监听者
@@ -471,6 +473,8 @@ public class ScheduledMessageProducer {
public static void main(String[] args) throws Exception {
// 实例化一个生产者来产生延时消息
DefaultMQProducer producer = new DefaultMQProducer("ExampleProducerGroup");
+ // 设置NameServer的地址
+ producer.setNamesrvAddr("localhost:9876");
// 启动生产者
producer.start();
int totalMessagesToSend = 100;
diff --git a/docs/en/Example_Delay.md b/docs/en/Example_Delay.md
index fe41aed92..a136d25f3 100644
--- a/docs/en/Example_Delay.md
+++ b/docs/en/Example_Delay.md
@@ -15,6 +15,8 @@ public class ScheduledMessageConsumer {
public static void main(String[] args) throws Exception {
// Instantiate message consumer
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("ExampleConsumer");
+ // Specify name server addresses
+ consumer.setNamesrvAddr("localhost:9876");
// Subscribe topics
consumer.subscribe("TestTopic", "*");
// Register message listener
@@ -46,6 +48,8 @@ public class ScheduledMessageProducer {
public static void main(String[] args) throws Exception {
// Instantiate a producer to send scheduled messages
DefaultMQProducer producer = new DefaultMQProducer("ExampleProducerGroup");
+ // Specify name server addresses
+ producer.setNamesrvAddr("localhost:9876");
// Launch producer
producer.start();
int totalMessagesToSend = 100;