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

jinrongtong 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 808a747ce [ISSUE #5133] Use StandardCharsets.UTF_8 as default charset 
in oneway producer demo
808a747ce is described below

commit 808a747ce47f916f971ade9ab2942d0edee90000
Author: Leping Huang <[email protected]>
AuthorDate: Wed Sep 21 08:54:48 2022 +0800

    [ISSUE #5133] Use StandardCharsets.UTF_8 as default charset in oneway 
producer demo
---
 .../main/java/org/apache/rocketmq/example/simple/OnewayProducer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/example/src/main/java/org/apache/rocketmq/example/simple/OnewayProducer.java 
b/example/src/main/java/org/apache/rocketmq/example/simple/OnewayProducer.java
index 6932f669f..e4bb06678 100644
--- 
a/example/src/main/java/org/apache/rocketmq/example/simple/OnewayProducer.java
+++ 
b/example/src/main/java/org/apache/rocketmq/example/simple/OnewayProducer.java
@@ -18,7 +18,8 @@ package org.apache.rocketmq.example.simple;
 
 import org.apache.rocketmq.client.producer.DefaultMQProducer;
 import org.apache.rocketmq.common.message.Message;
-import org.apache.rocketmq.remoting.common.RemotingHelper;
+
+import java.nio.charset.StandardCharsets;
 
 public class OnewayProducer {
     public static void main(String[] args) throws Exception {
@@ -33,7 +34,7 @@ public class OnewayProducer {
             Message msg = new Message("TopicTest" /* Topic */,
                     "TagA" /* Tag */,
                     ("Hello RocketMQ " +
-                            i).getBytes(RemotingHelper.DEFAULT_CHARSET) /* 
Message body */
+                            i).getBytes(StandardCharsets.UTF_8) /* Message 
body */
             );
             //Call send message to deliver message to one of brokers.
             producer.sendOneway(msg);

Reply via email to