You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/12 06:53:18 UTC

[GitHub] [pulsar] shibd commented on a diff in pull request #15491: [improve][connector] Sink support custom acknowledge type

shibd commented on code in PR #15491:
URL: https://github.com/apache/pulsar/pull/15491#discussion_r871009890


##########
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java:
##########
@@ -132,6 +132,17 @@ protected Record<T> buildRecord(Consumer<T> consumer, Message<T> message) {
                 .message(message)
                 .schema(schema)
                 .topicName(message.getTopicName())
+                .customAckFunction(cumulative -> {
+                    try {
+                        if (cumulative) {
+                            consumer.acknowledgeCumulativeAsync(message);
+                        } else {
+                            consumer.acknowledgeAsync(message);
+                        }
+                    } finally {
+                        message.release();

Review Comment:
   Thanks reply, i fixed it.



-- 
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: commits-unsubscribe@pulsar.apache.org

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