Class RabbitMessageCloseable

java.lang.Object
io.micronaut.rabbitmq.bind.RabbitMessageCloseable
All Implemented Interfaces:
AutoCloseable

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

    • 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 Details

    • close

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

      @Deprecated public RabbitMessageCloseable withAcknowledge(@Nullable @Nullable Boolean acknowledge)
      Deprecated.
      as of 3.4.0
      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
    • withAcknowledgmentAction

      public RabbitMessageCloseable withAcknowledgmentAction(@NonNull @NonNull AcknowledgmentAction acknowledgmentAction)
      Builder style sets whether the message acknowledgment action should be addressed and message should be acknowledged or rejected, or otherwise should acknowledgment action be skipped. Set to AcknowledgmentAction.ACK if the message should be acknowledged. Set to AcknowledgmentAction.NACK if the message should be rejected. Set to AcknowledgmentAction.NONE if the message should not be acknowledged or rejected.
      Parameters:
      acknowledgmentAction - The acknowledgment action parameter.
      Returns:
      The same instance
      Since:
      3.4.0