@InterfaceStability.Evolving public interface MessageProcessor extends AutoCloseable
JavaInstanceRunnable.| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static MessageProcessor |
create(org.apache.pulsar.client.api.PulsarClient client,
org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails) |
Source |
getSource()
Return the source.
|
void |
postReceiveMessage(Record record) |
Record |
recieveMessage()
Get the next message to process
|
void |
sendOutputMessage(Record srcRecord,
org.apache.pulsar.client.api.MessageBuilder outputMsgBuilder)
Send the output message to the output topic.
|
void |
setupInput(Class<?> inputType)
Setup the source.
|
void |
setupOutput(org.apache.pulsar.functions.api.SerDe outputSerDe)
Setup the output with a provided outputSerDe.
|
static MessageProcessor create(org.apache.pulsar.client.api.PulsarClient client, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails)
void postReceiveMessage(Record record)
void setupInput(Class<?> inputType) throws Exception
inputType - the input type of the functionExceptionSource getSource()
void setupOutput(org.apache.pulsar.functions.api.SerDe outputSerDe)
throws Exception
outputSerDe - output serde.Exceptionvoid sendOutputMessage(Record srcRecord, org.apache.pulsar.client.api.MessageBuilder outputMsgBuilder) throws org.apache.pulsar.client.api.PulsarClientException, Exception
If the outputMsgBuilder is null, the implementation doesn't have to send any messages to the output. The implementation can decide to acknowledge the input message based on its process guarantees.
srcRecord - record from sourceoutputMsgBuilder - output message builder. it can be null.org.apache.pulsar.client.api.PulsarClientExceptionExceptionRecord recieveMessage() throws Exception
Exceptionvoid close()
close in interface AutoCloseableCopyright © 2017–2018 Apache Software Foundation. All rights reserved.