zongtanghu commented on a change in pull request #576:
URL: https://github.com/apache/rocketmq-externals/pull/576#discussion_r440015283



##########
File path: 
rocketmq-flume/rocketmq-flume-source/src/main/java/org/apache/rocketmq/flume/ng/source/RocketMQSource.java
##########
@@ -119,31 +116,19 @@ protected Status doProcess() throws 
EventDeliveryException {
         Map<String, String> headers;
 
         try {
-            Set<MessageQueue> queues = 
consumer.fetchSubscribeMessageQueues(topic);
-            for (MessageQueue queue : queues) {
-                long offset = getMessageQueueOffset(queue);
-                PullResult pullResult = consumer.pull(queue, tag, offset, 
batchSize);
+            List<MessageExt> messageExts = consumer.poll();
+            for (MessageExt msg : messageExts) {
+                byte[] body = msg.getBody();
 
+                headers = new HashMap<>();
+                headers.put(HEADER_TOPIC_NAME, topic);
+                headers.put(HEADER_TAG_NAME, tag);
                 if (log.isDebugEnabled()) {

Review comment:
       @vongosling I think, may DefaultLitePullConsumer is better to adapter 
this scenario.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to