Uses of Interface
org.apache.pulsar.client.api.Message
Package
Description
Pulsar Client API.
Pulsar interceptors.
-
Uses of Message in org.apache.pulsar.client.api
Modifier and TypeMethodDescription<T> Message<T>
MessagePayloadContext.asSingleMessage
(MessagePayload payload, Schema<T> schema) Convert the given payload to a single message if the entry is not a batch.ConsumerInterceptor.beforeConsume
(Consumer<T> consumer, Message<T> message) This is called just before the message is returned byConsumer.receive()
,MessageListener.received(Consumer, Message)
or theCompletableFuture
returned byConsumer.receiveAsync()
completes.ReaderInterceptor.beforeRead
(Reader<T> reader, Message<T> message) This is called just before the message is returned byReader.readNext()
,ReaderListener.received(Reader, Message)
or theCompletableFuture
returned byReader.readNextAsync()
completes.ProducerInterceptor.beforeSend
(Producer<T> producer, Message<T> message) Deprecated.This is called fromProducer.send(Object)
andProducer.sendAsync(Object)
methods, before send the message to the brokers.<T> Message<T>
MessagePayloadContext.getMessageAt
(int index, int numMessages, MessagePayload payload, boolean containMetadata, Schema<T> schema) Get the internal single message with a specific index from a payload if the payload is a batch.Reader.readNext()
Read the next message in the topic.Read the next message in the topic waiting for a maximum time.Consumer.receive()
Receives a single message.Receive a single message.Modifier and TypeMethodDescriptionReader.readNextAsync()
Read asynchronously the next message in the topic.Consumer.receiveAsync()
Receive a single messageModifier and TypeMethodDescriptiondefault void
MessageAcknowledger.acknowledge
(Message<?> message) MessageAcknowledger.acknowledgeAsync
(Message<?> message) The asynchronous version ofMessageAcknowledger.acknowledge(Message)
.default void
MessageAcknowledger.acknowledgeCumulative
(Message<?> message) default CompletableFuture<Void>
MessageAcknowledger.acknowledgeCumulativeAsync
(Message<?> message) The asynchronous version ofMessageAcknowledger.acknowledgeCumulative(Message)
.ConsumerInterceptor.beforeConsume
(Consumer<T> consumer, Message<T> message) This is called just before the message is returned byConsumer.receive()
,MessageListener.received(Consumer, Message)
or theCompletableFuture
returned byConsumer.receiveAsync()
completes.ReaderInterceptor.beforeRead
(Reader<T> reader, Message<T> message) This is called just before the message is returned byReader.readNext()
,ReaderListener.received(Reader, Message)
or theCompletableFuture
returned byReader.readNextAsync()
completes.ProducerInterceptor.beforeSend
(Producer<T> producer, Message<T> message) Deprecated.This is called fromProducer.send(Object)
andProducer.sendAsync(Object)
methods, before send the message to the brokers.default int
MessageRouter.choosePartition
(Message<?> msg) Deprecated.since 1.22.0.default int
MessageRouter.choosePartition
(Message<?> msg, TopicMetadata metadata) Choose a partition based on msg and the topic metadata.void
Consumer.negativeAcknowledge
(Message<?> message) Acknowledge the failure to process a single message.void
ProducerInterceptor.onSendAcknowledgement
(Producer<T> producer, Message<T> message, MessageId msgId, Throwable exception) Deprecated.This method is called when the message sent to the broker has been acknowledged, or when sending the message fails.void
This method is called whenever a new message is received.void
This method is called whenever a new message is received.void
Consumer.reconsumeLater
(Message<?> message, long delayTime, TimeUnit unit) reconsumeLater the consumption ofMessages
.void
Consumer.reconsumeLater
(Message<?> message, Map<String, String> customProperties, long delayTime, TimeUnit unit) reconsumeLater the consumption ofMessages
.Consumer.reconsumeLaterAsync
(Message<?> message, long delayTime, TimeUnit unit) Asynchronously reconsumeLater the consumption of a single message.Consumer.reconsumeLaterAsync
(Message<?> message, Map<String, String> customProperties, long delayTime, TimeUnit unit) Asynchronously reconsumeLater the consumption of a single message.void
Consumer.reconsumeLaterCumulative
(Message<?> message, long delayTime, TimeUnit unit) reconsumeLater the reception of all the messages in the stream up to (and including) the provided message.Consumer.reconsumeLaterCumulativeAsync
(Message<?> message, long delayTime, TimeUnit unit) Asynchronously ReconsumeLater the reception of all the messages in the stream up to (and including) the provided message.Consumer.reconsumeLaterCumulativeAsync
(Message<?> message, Map<String, String> customProperties, long delayTime, TimeUnit unit) Asynchronously ReconsumeLater the reception of all the messages in the stream up to (and including) the provided message.Modifier and TypeMethodDescription<T> void
MessagePayloadProcessor.process
(MessagePayload payload, MessagePayloadContext context, Schema<T> schema, Consumer<Message<T>> messageConsumer) Process the message payload. -
Uses of Message in org.apache.pulsar.client.api.interceptor
Modifier and TypeMethodDescriptionProducerInterceptor.beforeSend
(Producer producer, Message message) This is called fromProducer.send(Object)
andProducer.sendAsync(Object)
methods, before send the message to the brokers.ProducerInterceptorWrapper.beforeSend
(Producer producer, Message message) Modifier and TypeMethodDescriptionProducerInterceptor.beforeSend
(Producer producer, Message message) This is called fromProducer.send(Object)
andProducer.sendAsync(Object)
methods, before send the message to the brokers.ProducerInterceptorWrapper.beforeSend
(Producer producer, Message message) boolean
Check whether the interceptor is eligible for this message.boolean
void
ProducerInterceptor.onSendAcknowledgement
(Producer producer, Message message, MessageId msgId, Throwable exception) This method is called when the message sent to the broker has been acknowledged, or when sending the message fails.void
ProducerInterceptorWrapper.onSendAcknowledgement
(Producer producer, Message message, MessageId msgId, Throwable exception)