Interface MessageResult<T>
-
- Type Parameters:
T- the message payload type
public interface MessageResult<T>Result of a message processing.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <V> MessageResult<java.lang.Void>acknowledge(org.apache.pulsar.client.api.Message<V> message)Returns an empty value and signals that the message must be acknowledged.static MessageResult<java.lang.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.MessageIdgetMessageId()Gets the id of the message to acknowledge or negatively acknowledge.TgetValue()Gets the value processed by the message processing.booleanisAcknowledgeMessage()Gets whether the message must be acknowledged.static <V> MessageResult<java.lang.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<java.lang.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 Detail
-
acknowledge
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.- 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
static MessageResult<java.lang.Void> acknowledge(org.apache.pulsar.client.api.MessageId messageId)
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
static MessageResult<java.lang.Void> negativeAcknowledge(org.apache.pulsar.client.api.MessageId messageId)
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
static <V> MessageResult<java.lang.Void> acknowledge(org.apache.pulsar.client.api.Message<V> message)
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
static <V> MessageResult<java.lang.Void> negativeAcknowledge(org.apache.pulsar.client.api.Message<V> message)
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
-
-