Package io.micronaut.rabbitmq.bind
Class RabbitMessageCloseable
java.lang.Object
io.micronaut.rabbitmq.bind.RabbitMessageCloseable
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionRabbitMessageCloseable
(RabbitConsumerState consumerState, boolean multiple, boolean reQueue) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
withAcknowledge
(@Nullable Boolean acknowledge) Deprecated.as of 3.4.0withAcknowledgmentAction
(@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.
-
Constructor Details
-
RabbitMessageCloseable
Default constructor.- Parameters:
consumerState
- The message statemultiple
- Whether multiple messages should be responded toreQueue
- 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 interfaceAutoCloseable
- Throws:
io.micronaut.messaging.exceptions.MessageAcknowledgementException
-
withAcknowledge
Deprecated.as of 3.4.0Builder 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 toAcknowledgmentAction.ACK
if the message should be acknowledged. Set toAcknowledgmentAction.NACK
if the message should be rejected. Set toAcknowledgmentAction.NONE
if the message should not be acknowledged or rejected.- Parameters:
acknowledgmentAction
- The acknowledgment action parameter.- Returns:
- The same instance
- Since:
- 3.4.0
-