You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/25 05:21:21 UTC

[GitHub] [rocketmq-site] RockChuLee opened a new pull request, #164: New official website

RockChuLee opened a new pull request, #164:
URL: https://github.com/apache/rocketmq-site/pull/164

   Please do not create a Pull Request without creating an issue first. 
   
   ## What is the purpose of the change
   
   1.Modify the typo in 08message4.md
   2.Add the English-version Batch Message Sending of Producer.
   
   ## Brief changelog
   
   Add 02-Producer/08message4.md
   
   Follow this checklist to help us incorporate your contribution quickly and easily:
   
   - [x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [ ] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [ ] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-site] tsunghanjacktsai commented on a diff in pull request #164: New official website

Posted by GitBox <gi...@apache.org>.
tsunghanjacktsai commented on code in PR #164:
URL: https://github.com/apache/rocketmq-site/pull/164#discussion_r934093277


##########
docs/09-英文/02-Producer/08message4.md:
##########
@@ -0,0 +1,29 @@
+# Batch Message Sending
+
+In the case of certain requirements on throughput, Apache RocketMQ can send messages after grouping them into batches. The approach is able to increase throughput and decrease the times of API and network calls.
+
+![batch](../../picture/batch.png)
+
+```javascript {10,11,12,13}
+public class SimpleBatchProducer {
+
+    public static void main(String[] args) throws Exception {
+        DefaultMQProducer producer = new DefaultMQProducer("BatchProducerGroupName");
+        producer.start();
+
+        //If you just send messages of no more than 1MiB at a time, it is easy to use batch
+        //Messages of the same batch should have: same topic, same waitStoreMsgOK and no schedule support
+        String topic = "BatchTest";
+        List<Message> messages = new ArrayList<>();
+        messages.add(new Message(topic, "Tag", "OrderID001", "Hello world 0".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID002", "Hello world 1".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID003", "Hello world 2".getBytes()));
+
+        producer.send(messages);
+    }
+}
+```
+
+:::note
+The call here is simple, where it packages the message as Collection<Message> msgs and passes it into the method as a parameter. There are two things to note here. First of all, the size of the batch message cannot exceed 1 MiB, otherwise, it needs to be split. Secondly, the message topic within the same batch must be identical.

Review Comment:
   Guess you forgot this after changing haha. Collection<Message> should be quoted `Collection<Message>`.
   
   LGTM for the rest 👍 



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-site] RongtongJin merged pull request #164: Batch Message Sending

Posted by GitBox <gi...@apache.org>.
RongtongJin merged PR #164:
URL: https://github.com/apache/rocketmq-site/pull/164


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-site] RockChuLee commented on pull request #164: New official website

Posted by GitBox <gi...@apache.org>.
RockChuLee commented on PR #164:
URL: https://github.com/apache/rocketmq-site/pull/164#issuecomment-1200509893

   Hi, @tsunghanjacktsai ,
   
   Nice to talk with you, your suggestion is good. I solve all them and learn a lot. Thanks


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-site] tsunghanjacktsai commented on a diff in pull request #164: New official website

Posted by GitBox <gi...@apache.org>.
tsunghanjacktsai commented on code in PR #164:
URL: https://github.com/apache/rocketmq-site/pull/164#discussion_r933293162


##########
docs/09-英文/02-Producer/08message4.md:
##########
@@ -0,0 +1,29 @@
+# Batch Message Sending
+
+In the case of certain requirements on throughput, Apache RocketMQ can group messages into batches and send them. The approach can increase throughput rate and decrease the times of calls of API and network calls.
+
+![batch](../../picture/batch.png)
+
+```javascript {10,11,12,13}
+public class SimpleBatchProducer {
+
+    public static void main(String[] args) throws Exception {
+        DefaultMQProducer producer = new DefaultMQProducer("BatchProducerGroupName");
+        producer.start();
+
+        //If you just send messages of no more than 1MiB at a time, it is easy to use batch
+        //Messages of the same batch should have: same topic, same waitStoreMsgOK and no schedule support
+        String topic = "BatchTest";
+        List<Message> messages = new ArrayList<>();
+        messages.add(new Message(topic, "Tag", "OrderID001", "Hello world 0".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID002", "Hello world 1".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID003", "Hello world 2".getBytes()));
+
+        producer.send(messages);
+    }
+}
+```
+
+:::note
+This call is very simple, packaging the message as `Collection<Message> msgs` and passing it into the method as a parameter. Here are two points to notice. At first, the size of the batch message cannot exceed 1 MiB, otherwise, it needs to be split. Secondly, the topic of the message in the same batch must be the same.

Review Comment:
   > This call is very simple, packaging the message as `Collection<Message> msgs` and passing it into the method as a parameter. Here are two points to notice. At first, the size of the batch message cannot exceed 1 MiB, otherwise, it needs to be split. Secondly, the topic of the message in the same batch must be the same.
   
   Make a small change would sound better:
   
   > The call here is simple, where it packages the message as `Collection<Message> msgs` and passes it into the method as a parameter. There are two things to note here. First of all, the size of the batch message cannot exceed 1 MiB, otherwise, it needs to be split. Secondly, the message topic within the same batch must be identical.



##########
docs/09-英文/02-Producer/08message4.md:
##########
@@ -0,0 +1,29 @@
+# Batch Message Sending
+
+In the case of certain requirements on throughput, Apache RocketMQ can group messages into batches and send them. The approach can increase throughput rate and decrease the times of calls of API and network calls.

Review Comment:
   > In the case of certain requirements on throughput, Apache RocketMQ can group messages into batches and send them. The approach can increase throughput rate and decrease the times of calls of API and network calls.
   
   Would better rephrase to:
   
   > In the case of certain requirements on throughput, Apache RocketMQ can send messages after grouping them into batches. The approach is able to increase throughput and decrease the times of API and network calls.



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-site] RockChuLee commented on a diff in pull request #164: New official website

Posted by GitBox <gi...@apache.org>.
RockChuLee commented on code in PR #164:
URL: https://github.com/apache/rocketmq-site/pull/164#discussion_r934113483


##########
docs/09-英文/02-Producer/08message4.md:
##########
@@ -0,0 +1,29 @@
+# Batch Message Sending
+
+In the case of certain requirements on throughput, Apache RocketMQ can send messages after grouping them into batches. The approach is able to increase throughput and decrease the times of API and network calls.
+
+![batch](../../picture/batch.png)
+
+```javascript {10,11,12,13}
+public class SimpleBatchProducer {
+
+    public static void main(String[] args) throws Exception {
+        DefaultMQProducer producer = new DefaultMQProducer("BatchProducerGroupName");
+        producer.start();
+
+        //If you just send messages of no more than 1MiB at a time, it is easy to use batch
+        //Messages of the same batch should have: same topic, same waitStoreMsgOK and no schedule support
+        String topic = "BatchTest";
+        List<Message> messages = new ArrayList<>();
+        messages.add(new Message(topic, "Tag", "OrderID001", "Hello world 0".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID002", "Hello world 1".getBytes()));
+        messages.add(new Message(topic, "Tag", "OrderID003", "Hello world 2".getBytes()));
+
+        producer.send(messages);
+    }
+}
+```
+
+:::note
+The call here is simple, where it packages the message as Collection<Message> msgs and passes it into the method as a parameter. There are two things to note here. First of all, the size of the batch message cannot exceed 1 MiB, otherwise, it needs to be split. Secondly, the message topic within the same batch must be identical.

Review Comment:
   Has been modified



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org