This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch new-official-website
in repository https://gitbox.apache.org/repos/asf/rocketmq-site.git


The following commit(s) were added to refs/heads/new-official-website by this 
push:
     new 328fb33e21 Add English version of quick start (#689)
328fb33e21 is described below

commit 328fb33e218eaab4be4a0ce74c0374526da23155
Author: rongtong <[email protected]>
AuthorDate: Fri Aug 30 11:03:26 2024 +0800

    Add English version of quick start (#689)
    
    * Add English version of quick start
    
    * Add English version of quick start
---
 ...-4.x.md => 04quickstartWithHelmInKubernetes.md} |   4 +-
 .../04quickstartWithHelmInKubernetes.md            |  51 +++---
 .../04quickstartWithHelmInKubernetes.md            | 204 +++++++++++++++++++++
 .../04quickstartWithHelmInKubernetes.md            |  12 +-
 4 files changed, 240 insertions(+), 31 deletions(-)

diff --git a/docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md 
b/docs/01-quickstart/04quickstartWithHelmInKubernetes.md
similarity index 99%
copy from docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md
copy to docs/01-quickstart/04quickstartWithHelmInKubernetes.md
index 8c913674bd..749a4834e0 100644
--- a/docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md
+++ b/docs/01-quickstart/04quickstartWithHelmInKubernetes.md
@@ -3,12 +3,14 @@
 这一节介绍如何在 Kubernetes 环境下,使⽤ Helm 快速部署⼀个单节点 RocketMQ-4.x 版本的服务,并完成简单的消息收发。
 
 
-## 系统要求
+:::tip 系统要求
 
 - 一个运行中的 `Kubernetes` 集群
 - 已安装的 `Helm 3.7.0+`
 - 64位 `JDK 1.8+`
 
+:::
+
 
 ## 1.安装 Helm
 
diff --git a/docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md 
b/i18n/en/docusaurus-plugin-content-docs/current/01-quickstart/04quickstartWithHelmInKubernetes.md
similarity index 62%
rename from docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md
rename to 
i18n/en/docusaurus-plugin-content-docs/current/01-quickstart/04quickstartWithHelmInKubernetes.md
index 8c913674bd..e801ad8267 100644
--- a/docs/01-quickstart/04quickstartWithHelmInKubernetes-4.x.md
+++ 
b/i18n/en/docusaurus-plugin-content-docs/current/01-quickstart/04quickstartWithHelmInKubernetes.md
@@ -1,24 +1,26 @@
-# Kubernetes 部署 RocketMQ
+# Run RocketMQ with Kubernetes
 
-这一节介绍如何在 Kubernetes 环境下,使⽤ Helm 快速部署⼀个单节点 RocketMQ-4.x 版本的服务,并完成简单的消息收发。
+This section describes how to quickly deploy a single-node RocketMQ 4.x 
service in a Kubernetes and perform simple message sending and receiving.
 
 
-## 系统要求
+:::tip SYSTEM REQUIREMENTS
 
-- 一个运行中的 `Kubernetes` 集群
-- 已安装的 `Helm 3.7.0+`
-- 64位 `JDK 1.8+`
+- A running Kubernetes cluster
+- Installed Helm 3.7.0+
+- 64-bit JDK 1.8+
 
+:::
 
-## 1.安装 Helm
 
-确保你的系统上已经安装了 Helm:
+## 1.Install Helm
+
+Make sure Helm is installed on your system:
 
 ```bash
 $ helm version
 ```
 
-如果未安装 Helm(3.7.0以上版本),可以使用以下命令进行安装:
+If Helm (version 3.7.0 or above) is not installed, you can install it using 
the following command:
 
 ```bash
 $ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | 
bash
@@ -26,7 +28,7 @@ $ curl 
https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bas
 
 
 
-## 2.下载 RocketMQ Helm 仓库
+## 2.Download RocketMQ Helm Chart
 
 ```bash
 $ helm pull oci://registry-1.docker.io/apache/rocketmq --version 0.0.1 
@@ -34,15 +36,14 @@ $ tar -zxvf rocketmq-0.0.1.tgz
 ```
 
 
+## 3.Deploy RocketMQ
 
-## 3.部署 RocketMQ
-
-使⽤ Helm chart 部署 RocketMQ。
+Use the Helm chart to deploy RocketMQ.
 
 ```yaml
-#修改values.yaml中的配置(根据实际需求修改相关配置信息,如镜像版本,资源⼤⼩、副本数等,同时禁用proxy、controller功能)
+# Modify the configuration in values.yaml (adjust relevant configuration 
information according to actual needs, such as image version, resource size, 
number of replicas, etc., while disabling proxy and controller features)
 $ vim values.yaml
-##values.yaml, 将broker中的resources的limits、requests等参数修改调整成适宜大小, 修改镜像tag为4.9.6##
+## In values.yaml, modify parameters such as limits and requests in broker's 
resources to suitable sizes, and change the image tag to 4.9.6 ##
   resources:
     limits:
       cpu: 2
@@ -55,8 +56,8 @@ $ vim values.yaml
 
 ```bash
 $ helm install rocketmq-demo ./rocketmq
-#查看pod状态
-#若参数正常,则表明部署成功
+# Check pod status
+# If the parameters are normal, it indicates successful deployment
 $ kubectl get pods -o wide -n default
 NAMESPACE     NAME                                        READY   STATUS    
RESTARTS   AGE   IP                NODE         NOMINATED NODE   READINESS GATES
 default       rocketmq-demo-broker-0                      0/1     Running   0  
        19s   192.168.58.228    k8s-node02   <none>           <none>
@@ -64,31 +65,31 @@ default       rocketmq-demo-nameserver-6678bb86f6-62s5d   
0/1     Running   0
 ```
 
 
-## 4.验证消息发送和接收
+## 4.Validate Message Sending and Receiving
 
-使用tools工具测试验证消息发送和接收。
+Use tools to test and validate message sending and receiving.
 
 ``` bash
-#登录pod内(需要管理工具),也可以在宿主机执行
+# Log into the pod (requires management tools), or you can execute on the host
 $ kubectl exec -ti rocketmq-demo-broker-0  -- /bin/bash
 
-#通过mqadmin创建 Topic
+# Create Topic via mqadmin
 $ sh mqadmin updatetopic -t TopicTest -c DefaultCluster
 
-#发送消息(pod内操作)
+# Send message (execute within the pod)
 $ sh tools.sh org.apache.rocketmq.example.quickstart.Producer
 SendResult [sendStatus=SEND_OK, msgId=7F00000100E60F6F4D334B52982103E7, 
offsetMsgId=C0A83AE400002A9F000000000002ECD2, messageQueue=MessageQueue 
[topic=TopicTest, brokerName=rocketmq-demo-broker-0, queueId=2], 
queueOffset=124]
 
-#接收消息(pod内操作)
+# Receive message (execute within the pod)
 $ sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
 ConsumeMessageThread_please_rename_unique_group_name_4_16 Receive New 
Messages: [MessageExt [brokerName=rocketmq-demo-broker-0, queueId=2, 
storeSize=192, queueOffset=124, sysFlag=0, bornTimestamp=1723734104097, 
bornHost=/192.168.58.228:40492, storeTimestamp=1723734104097, 
storeHost=/192.168.58.228:10911, msgId=C0A83AE400002A9F000000000002ECD2, 
commitLogOffset=191698, bodyCRC=638172955, reconsumeTimes=0, 
preparedTransactionOffset=0, toString()=Message{topic='TopicTest', flag=0, 
properties [...]
 ```
 
 
-## 5.释放 RocketMQ 资源
+## 5.Release RocketMQ Resources
 
 ```bash
-#释放所有 RocketMQ 资源
+#Release all RocketMQ resources
 $ helm uninstall rocketmq-demo
 ```
 
diff --git 
a/i18n/en/docusaurus-plugin-content-docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
 
b/i18n/en/docusaurus-plugin-content-docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
new file mode 100644
index 0000000000..1b3ecf4310
--- /dev/null
+++ 
b/i18n/en/docusaurus-plugin-content-docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
@@ -0,0 +1,204 @@
+# Run RocketMQ with Kubernetes
+
+This section describes how to quickly deploy a single-node RocketMQ 5.x 
service in a Kubernetes and perform simple message sending and receiving.
+
+
+:::tip SYSTEM REQUIREMENTS
+
+- A running Kubernetes cluster
+- Installed Helm 3.7.0+
+- 64-bit JDK 1.8+
+
+:::
+
+
+## 1.Install Helm
+
+Make sure Helm is installed on your system:
+
+```bash
+$ helm version
+```
+
+If Helm (version 3.7.0 or above) is not installed, you can install it using 
the following command:
+
+```bash
+$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | 
bash
+```
+
+
+
+## 2.Download RocketMQ Helm Chart
+
+```bash
+$ helm pull oci://registry-1.docker.io/apache/rocketmq --version 0.0.1 
+$ tar -zxvf rocketmq-0.0.1.tgz
+```
+
+
+## 3.Deploy RocketMQ
+
+Use the Helm chart to deploy RocketMQ.
+
+```yaml
+# Modify the configuration in values.yaml
+$ vim values.yaml
+## values.yaml, adjust memory requests and limits in broker resources 
according to available memory size ##
+  resources:
+    limits:
+      cpu: 2
+      memory: 10Gi
+    requests:
+      cpu: 2
+      memory: 10Gi
+##values.yaml##
+```
+
+```bash
+$ helm install rocketmq-demo ./rocketmq
+# Check pod status
+# If the parameters are normal, it indicates successful deployment
+$ kubectl get pods -o wide -n default
+NAME                                        READY   STATUS    RESTARTS       
AGE    IP               NODE         NOMINATED NODE   READINESS GATES
+rocketmq-demo-broker-0                      1/1     Running   0              
6h3m   192.168.58.225   k8s-node02   <none>           <none>
+rocketmq-demo-nameserver-757877747b-k669k   1/1     Running   0              
6h3m   192.168.58.226   k8s-node02   <none>           <none>
+rocketmq-demo-proxy-6c569bd457-wcg6g        1/1     Running   0              
6h3m   192.168.85.227   k8s-node01   <none>           <none>
+```
+
+
+## 4.Validate Message Sending and Receiving
+
+Use the JAVA SDK to test message sending and receiving (since the local 
network and the k8s network are not on the same internal network, you need to 
package the project locally and run it remotely. After packaging, copy the jar 
file from the target directory to the target server and execute java -jar jar 
file name). The specifics are as follows:
+
+1)Create a Java project in IDE.
+
+2)Add the following dependency to the pom.xml file to import the Java library:
+```xml
+ ...... 
+    <dependency>
+            <groupId>org.apache.rocketmq</groupId>
+            <artifactId>rocketmq-client-java</artifactId>
+            <version>5.0.7</version>
+      </dependency>
+    .....
+```
+3)Log into the pod (management tools are needed), or it can also be executed 
on the host
+```bash
+# Log into the pod
+$ kubectl exec -ti rocketmq-demo-broker-0  -- /bin/bash
+
+# Create Topic using mqadmin tools
+$ sh mqadmin updatetopic  -t TestTopic -c DefaultCluster
+
+# Create subscription group using mqadmin tools
+$ sh mqadmin updateSubGroup -c DefaultCluster -g TestGroup
+```
+4)In the created Java project, create a program to send normal messages 
(ProducerDemo.java); the sample code is as follows:
+
+```java
+package com.rocketmq.producer;
+
+import org.apache.rocketmq.client.apis.ClientConfiguration;
+import org.apache.rocketmq.client.apis.ClientConfigurationBuilder;
+import org.apache.rocketmq.client.apis.ClientException;
+import org.apache.rocketmq.client.apis.ClientServiceProvider;
+import org.apache.rocketmq.client.apis.message.Message;
+import org.apache.rocketmq.client.apis.producer.Producer;
+import org.apache.rocketmq.client.apis.producer.SendReceipt;
+
+public class ProducerDemo {
+    public static void main(String[] args) throws ClientException {
+        // The endpoint address, which needs to be set to the address and port 
list of the Proxy; the following is the proxy address in the k8s environment.
+        String endpoint = "192.168.85.227:8081";
+        // The target Topic name for sending messages, which needs to be 
created in advance.
+        String topic = "TestTopic";
+        ClientServiceProvider provider = ClientServiceProvider.loadService();
+        ClientConfigurationBuilder builder = 
ClientConfiguration.newBuilder().setEndpoints(endpoint);
+        ClientConfiguration configuration = builder.build();
+        // When initializing the Producer, communication configuration and 
pre-bound Topic need to be set.
+        Producer producer = provider.newProducerBuilder()
+            .setTopics(topic)
+            .setClientConfiguration(configuration)
+            .build();
+        // Sending normal messages.
+        Message message = provider.newMessageBuilder()
+            .setTopic(topic)
+            // Set message index key for precise search of a specific message.
+            .setKeys("messageKey")
+            // Set message Tag for filtering messages based on specific tags 
on the consumer side.
+            .setTag("messageTag")
+            // Message body.
+            .setBody("messageBody".getBytes())
+            .build();
+        try {
+            // Send the message, you need to pay attention to the sending 
result and handle failures and other exceptions.
+            SendReceipt sendReceipt = producer.send(message);
+            System.out.println("Send message successfully, messageId=" + 
sendReceipt.getMessageId());
+        } catch (ClientException e) {
+        }
+        // producer.close();
+    }
+}
+```
+
+5)In the created Java project, create a program to subscribe to normal 
messages (Consumer.java). Apache RocketMQ supports 
[SimpleConsumer](https://rocketmq.apache.org/zh/docs/featureBehavior/06consumertype)
 and 
[PushConsumer](https://rocketmq.apache.org/zh/docs/featureBehavior/06consumertype),
 here we use the PushConsumer.
+
+```java
+
+package com.rocketmq.consumer;
+
+import java.io.IOException;
+import java.util.Collections;
+import org.apache.rocketmq.client.apis.ClientConfiguration;
+import org.apache.rocketmq.client.apis.ClientException;
+import org.apache.rocketmq.client.apis.ClientServiceProvider;
+import org.apache.rocketmq.client.apis.consumer.ConsumeResult;
+import org.apache.rocketmq.client.apis.consumer.FilterExpression;
+import org.apache.rocketmq.client.apis.consumer.FilterExpressionType;
+import org.apache.rocketmq.client.apis.consumer.PushConsumer;
+import java.util.List;
+
+public class Consumer {
+    public static void main(String[] args) throws ClientException, 
IOException, InterruptedException {
+        final ClientServiceProvider provider = 
ClientServiceProvider.loadService();
+        // The endpoint address, which needs to be set to the address and port 
list of the Proxy; the following is the proxy address in the k8s environment.
+        String endpoints = "192.168.85.227:8081";
+        ClientConfiguration clientConfiguration = 
ClientConfiguration.newBuilder()
+            .setEndpoints(endpoints)
+            .build();
+        // The filter rule for subscribing to messages, indicating 
subscription to messages of all Tags.
+        String tag = "*";
+        FilterExpression filterExpression = new FilterExpression(tag, 
FilterExpressionType.TAG);
+        // Specify the consumer group to which the consumer belongs; the Group 
needs to be created in advance.
+        String consumerGroup = "TestGroup";
+        // Specify which target Topic needs to be subscribed to; the Topic 
needs to be created in advance.
+        String topic = "TestTopic";
+        // Initialize PushConsumer, binding to the consumer group 
ConsumerGroup, communication parameters, and subscription relationship.
+        PushConsumer pushConsumer = provider.newPushConsumerBuilder()
+            .setClientConfiguration(clientConfiguration)
+            // Set consumer group.
+            .setConsumerGroup(consumerGroup)
+            // Set pre-bound subscription relationship.
+            .setSubscriptionExpressions(Collections.singletonMap(topic, 
filterExpression))
+            // Set consumption listener.
+            .setMessageListener(messageView -> {
+                // Process the message and return the consumption result.
+                System.out.println("Consume message successfully, messageId=" 
+ messageView.getMessageId());
+                return ConsumeResult.SUCCESS;
+            })
+            .build();
+        Thread.sleep(Long.MAX_VALUE);
+        // If you don't need to use PushConsumer anymore, you can close this 
instance.
+        // pushConsumer.close();
+    }
+}
+
+```
+
+## 5.Release RocketMQ Resources
+
+```bash
+#Release all RocketMQ resources
+$ helm uninstall rocketmq-demo
+```
+
diff --git 
a/versioned_docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md 
b/versioned_docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
index 82854d906d..949d898ebc 100644
--- 
a/versioned_docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
+++ 
b/versioned_docs/version-5.0/02-quickStart/04quickstartWithHelmInKubernetes.md
@@ -1,12 +1,14 @@
 # Kubernetes 部署 RocketMQ
 本文介绍在 Kubernetes 环境下如何使用 Helm 快速部署一个单节点 RocketMQ-5.X 版本的服务,并完成简单的消息收发。
 
-## 前提条件
+:::tip 系统要求
 
 - 一个运行中的 `Kubernetes` 集群
 - 已安装的 `Helm 3.7.0+ `
 - 64位 `JDK 1.8+`
 
+:::
+
 ## 1.安装 Helm
 
 确保你的系统上已经安装了 Helm:
@@ -71,15 +73,15 @@ rocketmq-demo-proxy-6c569bd457-wcg6g        1/1     Running 
  3 (6h2m ago)   6h3
       </dependency>
     .....
 ```
-3)使用 mqadmin 创建 Topic和消费者。
+3)使用 mqadmin 工具创建 Topic和消费者。
 ```bash
-#登录pod内(需要管理工具),也可以在宿主机执行
+# 登录 pod 内
 $ kubectl exec -ti rocketmq-demo-broker-0  -- /bin/bash
 
-#通过mqadmin创建Topic
+# 通过 mqadmin 创建 Topic
 $ sh mqadmin updatetopic  -t TestTopic -c DefaultCluster
 
-#通过mqadmin创建消费者Group
+# 通过 mqadmin 创建订阅组
 $ sh mqadmin updateSubGroup -c DefaultCluster -g TestGroup
 ```
 4)在已创建的Java工程中,创建发送普通消息程序 (ProducerDemo.java),示例代码如下:

Reply via email to