From 603746f916bc23141d1216a57127d755db20021d Mon Sep 17 00:00:00 2001 From: zzzzzhangyanqiu Date: Mon, 25 Mar 2024 17:46:12 +0800 Subject: [PATCH] [ISSUE #7949] Fix spelling mistakes in SendResut (#630) Co-authored-by: zhangyanqiu --- docs/02-producer/02message1.md | 2 +- .../current/02-producer/02message1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-producer/02message1.md b/docs/02-producer/02message1.md index a8ec08fc09..bded459c8b 100644 --- a/docs/02-producer/02message1.md +++ b/docs/02-producer/02message1.md @@ -60,7 +60,7 @@ Apache RocketMQ可用于以三种方式发送消息:**同步、异步和单向 1. **首先会创建一个producer**。普通消息可以创建 DefaultMQProducer,创建时需要填写生产组的名称,生产者组是指同一类Producer的集合,这类Producer发送同一类消息且发送逻辑一致。 2. **设置 NameServer 的地址**。Apache RocketMQ很多方式设置NameServer地址(客户端配置中有介绍),这里是在代码中调用producer的API setNamesrvAddr进行设置,如果有多个NameServer,中间以分号隔开,比如"127.0.0.2:9876;127.0.0.3:9876"。 3. **第三步是构建消息**。指定topic、tag、body等信息,tag可以理解成标签,对消息进行再归类,RocketMQ可以在消费端对tag进行过滤。 -4. **最后调用send接口将消息发送出去**。同步发送等待结果最后返回SendResult,SendResut包含实际发送状态还包括SEND_OK(发送成功), FLUSH_DISK_TIMEOUT(刷盘超时), FLUSH_SLAVE_TIMEOUT(同步到备超时), SLAVE_NOT_AVAILABLE(备不可用),如果发送失败会抛出异常。 +4. **最后调用send接口将消息发送出去**。同步发送等待结果最后返回SendResult,SendResult包含实际发送状态还包括SEND_OK(发送成功), FLUSH_DISK_TIMEOUT(刷盘超时), FLUSH_SLAVE_TIMEOUT(同步到备超时), SLAVE_NOT_AVAILABLE(备不可用),如果发送失败会抛出异常。 ``` java public class SyncProducer { public static void main(String[] args) throws Exception { diff --git a/i18n/en/docusaurus-plugin-content-docs/current/02-producer/02message1.md b/i18n/en/docusaurus-plugin-content-docs/current/02-producer/02message1.md index e09baa5927..2d2e7576bc 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/02-producer/02message1.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/02-producer/02message1.md @@ -56,7 +56,7 @@ The entire code for synchronous sending is as follows: 1. **Create a Producer**. Create a DefaultMQProducer in advance. The Producer should contain the name of the Producer group, which is a collection of Producer, they would send the same type of messages with identical logic. 2. **Set the address of NameServer**. Apache RocketMQ is able to set the address of the NameServer (described in the client configuration) in many ways. The following example is set by calling the producer's setNamesrvAddr() method in the code, separated by a semicolon if there is more than one NameServer, such as "127.0.0.2:9876;127.0.0.3:9876". 3. **Build the message**. Set the topic, tag, body, and so on. The tag can be understood as a label to categorize the message, and RocketMQ can filter the tag on the Consumer side. -4. **Call the send() method to send the message**. Ultimately, the send() method will return a SendResult. The SendResut contains the actual send status including SEND_OK (send success), FLUSH_DISK_TIMEOUT (disk flush timeout), FLUSH_SLAVE_TIMEOUT (sync to slave timeout), SLAVE_NOT_AVAILABLE (slave can not be used), and an exception is thrown if it fails. +4. **Call the send() method to send the message**. Ultimately, the send() method will return a SendResult. The SendResult contains the actual send status including SEND_OK (send success), FLUSH_DISK_TIMEOUT (disk flush timeout), FLUSH_SLAVE_TIMEOUT (sync to slave timeout), SLAVE_NOT_AVAILABLE (slave can not be used), and an exception is thrown if it fails. ``` java public class SyncProducer {