Interface AsyncCheckpointConsumer<T>

Type Parameters:
T - the type of message values

public interface AsyncCheckpointConsumer<T>
Asynchronous view of a CheckpointConsumer.

All operations return CompletableFuture and never block. Obtained via CheckpointConsumer.async().

  • Method Details

    • receive

      Receive a single message asynchronously.
      Returns:
      a CompletableFuture that completes with the next available message
    • receive

      CompletableFuture<Message<T>> receive(Duration timeout)
      Receive a single message, completing with null if the timeout elapses.
      Parameters:
      timeout - the maximum duration to wait for a message
      Returns:
      a CompletableFuture that completes with the next available message, or null if the timeout elapses
    • receiveMulti

      CompletableFuture<List<Message<T>>> receiveMulti(int maxMessages, Duration timeout)
      Receive a batch of messages asynchronously.
      Parameters:
      maxMessages - maximum number of messages to return
      timeout - maximum time to wait for messages
      Returns:
      a CompletableFuture that completes with a list of up to maxMessages messages
    • checkpoint

      Create a consistent checkpoint asynchronously.
      Returns:
      a CompletableFuture that completes with a Checkpoint representing the current position across all segments of the topic
    • close

      Close this consumer asynchronously.
      Returns:
      a CompletableFuture that completes when the consumer has been closed and all resources have been released