Interface ReactiveMessageConsumer<T>
-
- Type Parameters:
T
- the message payload type.
public interface ReactiveMessageConsumer<T>
Reactive message consumer interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <R> reactor.core.publisher.Flux<R>
consumeMany(java.util.function.Function<reactor.core.publisher.Flux<org.apache.pulsar.client.api.Message<T>>,org.reactivestreams.Publisher<MessageResult<R>>> messageHandler)
Consumes messages continuously.reactor.core.publisher.Mono<java.lang.Void>
consumeNothing()
Creates the Pulsar Consumer and immediately closes it.<R> reactor.core.publisher.Mono<R>
consumeOne(java.util.function.Function<org.apache.pulsar.client.api.Message<T>,org.reactivestreams.Publisher<MessageResult<R>>> messageHandler)
Consumes one message.default ReactiveMessagePipelineBuilder<T>
messagePipeline()
Creates a builder for building aReactiveMessagePipeline
.
-
-
-
Method Detail
-
consumeOne
<R> reactor.core.publisher.Mono<R> consumeOne(java.util.function.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
- aFunction
to apply to the consumed message that returns aMessageResult
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(java.util.function.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
- aFunction
to apply to the consumed messages that returnsMessageResult
s, 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
MessageResult
s returned by the message handler
-
messagePipeline
default ReactiveMessagePipelineBuilder<T> messagePipeline()
Creates a builder for building aReactiveMessagePipeline
.- Returns:
- a builder for building a
ReactiveMessagePipeline
-
consumeNothing
reactor.core.publisher.Mono<java.lang.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
-
-