Interface ReactiveMessagePipelineBuilder<T>

Type Parameters:
T - the message payload type
All Known Subinterfaces:
ReactiveMessagePipelineBuilder.ConcurrentOneByOneMessagePipelineBuilder<T>, ReactiveMessagePipelineBuilder.OneByOneMessagePipelineBuilder<T>

public interface ReactiveMessagePipelineBuilder<T>
Builder interface for ReactiveMessagePipeline.
  • Method Details

    • messageHandler

      ReactiveMessagePipelineBuilder.OneByOneMessagePipelineBuilder<T> messageHandler(Function<org.apache.pulsar.client.api.Message<T>,org.reactivestreams.Publisher<Void>> messageHandler)
      Sets a handler function that processes messages one-by-one.
      Parameters:
      messageHandler - a function that takes a message as input and returns an empty Publisher
      Returns:
      a builder for the pipeline handling messages one-by-one
    • streamingMessageHandler

      ReactiveMessagePipelineBuilder<T> streamingMessageHandler(Function<reactor.core.publisher.Flux<org.apache.pulsar.client.api.Message<T>>,org.reactivestreams.Publisher<MessageResult<Void>>> streamingMessageHandler)
      Sets a handler function that processes the stream of messages.
      Parameters:
      streamingMessageHandler - a function that takes a stream of messages as input and returns a MessageResult that contains the acknowledgement or negative acknowledgement value of the processing.
      Returns:
      the pipeline builder instance
    • transformPipeline

      ReactiveMessagePipelineBuilder<T> transformPipeline(Function<reactor.core.publisher.Mono<Void>,org.reactivestreams.Publisher<Void>> transformer)
      Sets a transform function that can be used to customize the pipeline.
      Parameters:
      transformer - a transform function
      Returns:
      the pipeline builder instance
      See Also:
      • Mono.transform(Function)
    • pipelineRetrySpec

      ReactiveMessagePipelineBuilder<T> pipelineRetrySpec(reactor.util.retry.Retry pipelineRetrySpec)
      Sets a retry spec that will be used in case of failures in the pipeline. The default is to retry indefinitely with an exponential backoff.
      Parameters:
      pipelineRetrySpec - the retry spec
      Returns:
      the pipeline builder instance
      See Also:
      • Mono.retryWhen(Retry)
    • build

      Builds the pipeline instance.
      Returns:
      the pipeline instance