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 forReactiveMessagePipeline
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ReactiveMessagePipelineBuilder.ConcurrentOneByOneMessagePipelineBuilder<T>
Builder interface for a pipeline that handles messages with concurrent one-by-one messages handlers.static interface
ReactiveMessagePipelineBuilder.OneByOneMessagePipelineBuilder<T>
Builder interface for a pipeline that handles messages one-by-one.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReactiveMessagePipeline
build()
Builds the pipeline instance.ReactiveMessagePipelineBuilder.OneByOneMessagePipelineBuilder<T>
messageHandler(java.util.function.Function<org.apache.pulsar.client.api.Message<T>,org.reactivestreams.Publisher<java.lang.Void>> messageHandler)
Sets a handler function that processes messages one-by-one.ReactiveMessagePipelineBuilder<T>
pipelineRetrySpec(reactor.util.retry.Retry pipelineRetrySpec)
Sets a retry spec that will be used in case of failures in the pipeline.ReactiveMessagePipelineBuilder<T>
streamingMessageHandler(java.util.function.Function<reactor.core.publisher.Flux<org.apache.pulsar.client.api.Message<T>>,org.reactivestreams.Publisher<MessageResult<java.lang.Void>>> streamingMessageHandler)
Sets a handler function that processes the stream of messages.ReactiveMessagePipelineBuilder<T>
transformPipeline(java.util.function.Function<reactor.core.publisher.Mono<java.lang.Void>,org.reactivestreams.Publisher<java.lang.Void>> transformer)
Sets a transform function that can be used to customize the pipeline.
-
-
-
Method Detail
-
messageHandler
ReactiveMessagePipelineBuilder.OneByOneMessagePipelineBuilder<T> messageHandler(java.util.function.Function<org.apache.pulsar.client.api.Message<T>,org.reactivestreams.Publisher<java.lang.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(java.util.function.Function<reactor.core.publisher.Flux<org.apache.pulsar.client.api.Message<T>>,org.reactivestreams.Publisher<MessageResult<java.lang.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(java.util.function.Function<reactor.core.publisher.Mono<java.lang.Void>,org.reactivestreams.Publisher<java.lang.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
ReactiveMessagePipeline build()
Builds the pipeline instance.- Returns:
- the pipeline instance
-
-