You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/04/20 14:27:43 UTC
Re: [PR] [feat] PIP-466: Add V5 client API for scalable topics [pulsar]
lhotari commented on code in PR #25489:
URL: https://github.com/apache/pulsar/pull/25489#discussion_r3111386499
##########
pulsar-client-api-v5/src/main/java/org/apache/pulsar/client/api/v5/async/AsyncQueueConsumer.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.client.api.v5.async;
+
+import java.util.concurrent.CompletableFuture;
+import org.apache.pulsar.client.api.v5.Message;
+import org.apache.pulsar.client.api.v5.MessageId;
+import org.apache.pulsar.client.api.v5.QueueConsumer;
+import org.apache.pulsar.client.api.v5.Transaction;
+
+/**
+ * Asynchronous view of a {@link QueueConsumer}.
+ *
+ * <p>All operations return {@link CompletableFuture} and never block.
+ * Obtained via {@link QueueConsumer#async()}.
+ *
+ * @param <T> the type of message values
+ */
+public interface AsyncQueueConsumer<T> {
+
+ /**
+ * Receive a single message asynchronously.
+ *
+ * @return a {@link CompletableFuture} that completes with the next available message
+ */
+ CompletableFuture<Message<T>> receive();
+
+ /**
+ * Acknowledge a single message by its ID.
+ *
+ * @param messageId the ID of the message to acknowledge
+ */
+ void acknowledge(MessageId messageId);
+
+ /**
+ * Acknowledge a single message.
+ *
+ * @param message the message to acknowledge
+ */
+ void acknowledge(Message<T> message);
Review Comment:
Is there a need to have support for async acknowledgements? With the current Pulsar client, this is mainly useful with ack-receipts which can be useful in some rare use cases. The reason why this has come up in the past is that some other message broker support a mode where acknowledgements are acknowledged. I haven't used this myself, but I've heard users requesting this. Without async support, ack receipts skill the performance.
--
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