public interface MessagePayloadProcessor
MessagePayloadContext.getMessageAt(int, int, org.apache.pulsar.client.api.MessagePayload, boolean, org.apache.pulsar.client.api.Schema<T>)
or MessagePayloadContext.asSingleMessage(org.apache.pulsar.client.api.MessagePayload, org.apache.pulsar.client.api.Schema<T>)
to construct
Message
for consumer to consume. Since we need to pass the MessagePayload
object to these methods, we
can use MessagePayloadFactory.DEFAULT
to create it or just reuse the payload argument.Modifier and Type | Field and Description |
---|---|
static MessagePayloadProcessor |
DEFAULT |
Modifier and Type | Method and Description |
---|---|
<T> void |
process(MessagePayload payload,
MessagePayloadContext context,
Schema<T> schema,
Consumer<Message<T>> messageConsumer)
Process the message payload.
|
static final MessagePayloadProcessor DEFAULT
<T> void process(MessagePayload payload, MessagePayloadContext context, Schema<T> schema, Consumer<Message<T>> messageConsumer) throws Exception
T
- payload
- the payload whose underlying buffer is a Netty ByteBufcontext
- the message context that contains the message format information and methods to create a messageschema
- the message's schemamessageConsumer
- the callback to consume each messageException
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.