Interface MessageResult<T>
- Type Parameters:
T- the message payload type
public interface MessageResult<T>
Result of a message processing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> MessageResult<Void>acknowledge(org.apache.pulsar.client.api.Message<V> message) Returns an empty value and signals that the message must be acknowledged.static MessageResult<Void>acknowledge(org.apache.pulsar.client.api.MessageId messageId) Returns an empty value and signals that the message must be acknowledged.static <T> MessageResult<T>acknowledge(org.apache.pulsar.client.api.MessageId messageId, T value) Returns the processed value and signals that the message must be acknowledged.static <V> MessageResult<org.apache.pulsar.client.api.Message<V>>acknowledgeAndReturn(org.apache.pulsar.client.api.Message<V> message) Returns a message and signals that it must be acknowledged.org.apache.pulsar.client.api.MessageIdGets the id of the message to acknowledge or negatively acknowledge.getValue()Gets the value processed by the message processing.booleanGets whether the message must be acknowledged.static <V> MessageResult<Void>negativeAcknowledge(org.apache.pulsar.client.api.Message<V> message) Returns an empty value and signals that the message must be negatively acknowledged.static MessageResult<Void>negativeAcknowledge(org.apache.pulsar.client.api.MessageId messageId) Returns an empty value and signals that the message must be negatively acknowledged.static <T> MessageResult<T>negativeAcknowledge(org.apache.pulsar.client.api.MessageId messageId, T value) Returns the processed value and signals that the message must be negatively acknowledged.
-
Method Details
-
acknowledge
Returns the processed value and signals that the message must be acknowledged.- Type Parameters:
T- the type of the processed value- Parameters:
messageId- the id of the message to acknowledgevalue- the processed value- Returns:
- the result of the message processing
-
negativeAcknowledge
static <T> MessageResult<T> negativeAcknowledge(org.apache.pulsar.client.api.MessageId messageId, T value) Returns the processed value and signals that the message must be negatively acknowledged.- Type Parameters:
T- the type of the processed value- Parameters:
messageId- the id of the message to negatively acknowledgevalue- the processed value- Returns:
- the result of the message processing
-
acknowledge
Returns an empty value and signals that the message must be acknowledged.- Parameters:
messageId- the id of the message to acknowledge- Returns:
- the result of the message processing
-
negativeAcknowledge
Returns an empty value and signals that the message must be negatively acknowledged.- Parameters:
messageId- the id of the message to negatively acknowledge- Returns:
- the result of the message processing
-
acknowledge
Returns an empty value and signals that the message must be acknowledged.- Type Parameters:
V- the type of message payload- Parameters:
message- the message to acknowledge- Returns:
- the result of the message processing
-
negativeAcknowledge
Returns an empty value and signals that the message must be negatively acknowledged.- Type Parameters:
V- the type of message payload- Parameters:
message- the message to negatively acknowledge- Returns:
- the result of the message processing
-
acknowledgeAndReturn
static <V> MessageResult<org.apache.pulsar.client.api.Message<V>> acknowledgeAndReturn(org.apache.pulsar.client.api.Message<V> message) Returns a message and signals that it must be acknowledged.- Type Parameters:
V- the type of message payload- Parameters:
message- the message- Returns:
- the result of the message processing
-
isAcknowledgeMessage
boolean isAcknowledgeMessage()Gets whether the message must be acknowledged.- Returns:
- true if the message must be acknowledged
-
getMessageId
org.apache.pulsar.client.api.MessageId getMessageId()Gets the id of the message to acknowledge or negatively acknowledge.- Returns:
- the id of the message
-
getValue
T getValue()Gets the value processed by the message processing.- Returns:
- the value
-