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
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Builder interface for a pipeline that handles messages with concurrent one-by-one messages handlers.static interface
Builder interface for a pipeline that handles messages one-by-one. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the pipeline instance.messageHandler
(Function<org.apache.pulsar.client.api.Message<T>, org.reactivestreams.Publisher<Void>> messageHandler) Sets a handler function that processes messages one-by-one.pipelineRetrySpec
(reactor.util.retry.Retry pipelineRetrySpec) Sets a retry spec that will be used in case of failures in the pipeline.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.transformPipeline
(Function<reactor.core.publisher.Mono<Void>, org.reactivestreams.Publisher<Void>> transformer) Sets a transform function that can be used to customize the pipeline.
-
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 aMessageResult
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
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
ReactiveMessagePipeline build()Builds the pipeline instance.- Returns:
- the pipeline instance
-