Class IncomingRabbitMQMessage<T>

  • Type Parameters:
    T - the message body type
    All Implemented Interfaces:
    Message<T>

    public class IncomingRabbitMQMessage<T>
    extends Object
    implements Message<T>
    An implementation of Message suitable for incoming RabbitMQ messages.
    • Method Detail

      • ack

        public CompletionStage<Void> ack()
        Description copied from interface: Message
        Acknowledge this message.
        Specified by:
        ack in interface Message<T>
        Returns:
        a completion stage completed when the message is acknowledged. If the acknowledgement fails, the completion stage propagates the failure.
      • nack

        public CompletionStage<Void> nack​(Throwable reason,
                                          Metadata metadata)
        Description copied from interface: Message
        Acknowledge negatively this message. nack is used to indicate that the processing of a message failed. The reason is passed as parameter. Additional metadata may be provided that the connector can use when nacking the message. The interpretation of metadata is connector-specific.
        Specified by:
        nack in interface Message<T>
        Parameters:
        reason - the reason of the nack, must not be null
        metadata - additional nack metadata the connector may use, may be null
        Returns:
        a completion stage completed when the message is negative-acknowledgement has completed. If the negative acknowledgement fails, the completion stage propagates the failure.
      • acknowledgeMessage

        public void acknowledgeMessage()
        Acknowledges the message.
      • rejectMessage

        public void rejectMessage​(Throwable reason)
        Rejects the message by nack'ing with requeue=false; this will either discard the message for good or (if a DLQ has been set up) send it to the DLQ.
        Parameters:
        reason - the cause of the rejection, which must not be null
      • getPayload

        public T getPayload()
        Specified by:
        getPayload in interface Message<T>
        Returns:
        The payload for this message.
      • getMetadata

        public Metadata getMetadata()
        Specified by:
        getMetadata in interface Message<T>
        Returns:
        The set of metadata attached to this message, potentially empty.
      • getRabbitMQMessage

        public io.vertx.mutiny.rabbitmq.RabbitMQMessage getRabbitMQMessage()
      • injectTracingMetadata

        public void injectTracingMetadata​(TracingMetadata tracingMetadata)