You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/09/19 06:37:44 UTC

[GitHub] [incubator-eventmesh] Markliniubility commented on a diff in pull request #1264: [ISSUE #1262] Kafka Support for manual acknowledgement

Markliniubility commented on code in PR #1264:
URL: https://github.com/apache/incubator-eventmesh/pull/1264#discussion_r973903035


##########
eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/consumer/KafkaConsumerRunner.java:
##########
@@ -64,29 +72,33 @@ public void commit(EventMeshAction action) {
                                 case CommitMessage:
                                     // update offset
                                     logger.info("message commit, topic: {}, current offset:{}", topicName,
-                                        offset.get());
+                                        rec.offset());
                                     break;
                                 case ReconsumeLater:
                                     // don't update offset
                                     break;
                                 case ManualAck:
                                     // update offset
-                                    offset.incrementAndGet();
                                     logger
-                                        .info("message ack, topic: {}, current offset:{}", topicName, offset.get());
+                                        .info("message ack, topic: {}, current offset:{}", topicName, rec.offset());
                                     break;
                                 default:
                             }
                         }
                     };
+                    cloudEventToOffset.put(cloudEvent, rec.offset());
                     if (listener != null) {
                         listener.consume(cloudEvent, eventMeshAsyncConsumeContext);
                     }
                 });
             }
         } catch (WakeupException e) {
             // Ignore exception if closing
-            if (!closed.get()) throw e;
+            if (!closed.get()) {

Review Comment:
   完成



-- 
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@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org