You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by go...@apache.org on 2021/01/13 03:08:22 UTC

[incubator-tubemq] branch master updated: [TUBEMQ-510] Found a bug in MessageProducerExample class

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

gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git


The following commit(s) were added to refs/heads/master by this push:
     new 9de68b6  [TUBEMQ-510] Found a bug in MessageProducerExample class
9de68b6 is described below

commit 9de68b636ff295c7354f22f76ddb7778a1a2603d
Author: gosonzhang <go...@tencent.com>
AuthorDate: Tue Jan 12 14:55:23 2021 +0800

    [TUBEMQ-510] Found a bug in MessageProducerExample class
---
 .../src/main/java/org/apache/tubemq/example/MessageProducerExample.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tubemq-example/src/main/java/org/apache/tubemq/example/MessageProducerExample.java b/tubemq-example/src/main/java/org/apache/tubemq/example/MessageProducerExample.java
index 2b806b5..0bac5ef 100644
--- a/tubemq-example/src/main/java/org/apache/tubemq/example/MessageProducerExample.java
+++ b/tubemq-example/src/main/java/org/apache/tubemq/example/MessageProducerExample.java
@@ -104,7 +104,7 @@ public final class MessageProducerExample {
             while (msgCount < 0 || sentCount < msgCount) {
                 roundIndex = (int) (sentCount++ % targetCnt);
                 Tuple2<String, String> target = topicSendRounds.get(roundIndex);
-                Message message = new Message(target.getF0(), body.getBytes());
+                Message message = new Message(target.getF0(), dataBuffer.array());
                 long currTimeMillis = System.currentTimeMillis();
                 message.setAttrKeyVal("index", String.valueOf(sentCount));
                 message.setAttrKeyVal("dataTime", String.valueOf(currTimeMillis));