Interface MessageResult<T>

Type Parameters:
T - the message payload type

public interface MessageResult<T>
Result of a message processing.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <V> MessageResult<Void>
    acknowledge(org.apache.pulsar.client.api.Message<V> message)
    Returns an empty value and signals that the message must be acknowledged.
    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.MessageId
    Gets the id of the message to acknowledge or negatively acknowledge.
    Gets the value processed by the message processing.
    boolean
    Gets 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.
    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

      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 acknowledge
      value - 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 acknowledge
      value - the processed value
      Returns:
      the result of the message processing
    • acknowledge

      static MessageResult<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<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<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<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