Class RabbitMessageCloseable

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class RabbitMessageCloseable
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Responsible for acknowledging or rejecting a message. Only applies if the consuming method does not have an Acknowledgement argument.
    Since:
    1.1.0
    • Constructor Detail

      • RabbitMessageCloseable

        public RabbitMessageCloseable​(RabbitConsumerState consumerState,
                                      boolean multiple,
                                      boolean reQueue)
        Default constructor.
        Parameters:
        consumerState - The message state
        multiple - Whether multiple messages should be responded to
        reQueue - Whether rejections should cause the messages to be re-queued
    • Method Detail

      • close

        public void close()
                   throws io.micronaut.messaging.exceptions.MessageAcknowledgementException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        io.micronaut.messaging.exceptions.MessageAcknowledgementException
      • withAcknowledge

        public RabbitMessageCloseable withAcknowledge​(@Nullable
                                                      java.lang.Boolean acknowledge)
        Builder style sets whether the message should be acknowledged. Set to true if the message should be acknowledged. Set to false if the message should be rejected. Set to null if the message should not be acknowledged or rejected.
        Parameters:
        acknowledge - The acknowledge parameter.
        Returns:
        The same instance