Interface ReactiveMessageConsumer<T>

Type Parameters:
T - the message payload type.

public interface ReactiveMessageConsumer<T>
Reactive message consumer interface.
  • Method Details

    • consumeOne

      <R> reactor.core.publisher.Mono<R> consumeOne(Function<org.apache.pulsar.client.api.Message<T>,org.reactivestreams.Publisher<MessageResult<R>>> messageHandler)
      Consumes one message.
      Type Parameters:
      R - the type of MessageResult returned by the message handler
      Parameters:
      messageHandler - a Function to apply to the consumed message that returns a MessageResult which contains the acknowledgement or negative acknowledgement referencing the message id of the input message together with an optional return value object
      Returns:
      the value contained by the MessageResult returned by the message handler
    • consumeMany

      <R> reactor.core.publisher.Flux<R> consumeMany(Function<reactor.core.publisher.Flux<org.apache.pulsar.client.api.Message<T>>,org.reactivestreams.Publisher<MessageResult<R>>> messageHandler)
      Consumes messages continuously.
      Type Parameters:
      R - the type of MessageResult returned by the message handler
      Parameters:
      messageHandler - a Function to apply to the consumed messages that returns MessageResults, each containing the acknowledgement or negative acknowledgement referencing the message id of the corresponding input messages together with an optional return value object
      Returns:
      the values contained by the MessageResults returned by the message handler
    • messagePipeline

      default ReactiveMessagePipelineBuilder<T> messagePipeline()
      Creates a builder for building a ReactiveMessagePipeline.
      Returns:
      a builder for building a ReactiveMessagePipeline
    • consumeNothing

      reactor.core.publisher.Mono<Void> consumeNothing()
      Creates the Pulsar Consumer and immediately closes it. This is useful for creating the Pulsar subscription that is related to the consumer. Nothing happens unless the returned Mono is subscribed.
      Returns:
      a Mono for consuming nothing