Class RangedAcknowledger
java.lang.Object
com.amazon.sqs.javamessaging.acknowledge.BulkSQSOperation
com.amazon.sqs.javamessaging.acknowledge.RangedAcknowledger
- All Implemented Interfaces:
Acknowledger
Used to acknowledge group of messages. Acknowledging a consumed message
acknowledges all messages that the session has consumed before and including
that message.
A big backlog of consumed messages can cause memory pressure, as well as an increase on the probability of duplicates.
This class is not safe for concurrent use.
-
Constructor Summary
ConstructorsConstructorDescriptionRangedAcknowledger(AmazonSQSMessagingClientWrapper amazonSQSClient, SQSSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(SQSMessage message) Acknowledges all the consumed messages as well as the previously consumed messages on the session via callingdeleteMessageBatchuntil all the messages are deleted.voidAcknowledges up to 10 messages via callingdeleteMessageBatch.voidClears the list of not acknowledged messages.Returns the list of all consumed but not acknowledged messages.voidnotifyMessageReceived(SQSMessage message) Updates the internal queue for the consumed but not acknowledged messages if the message was not already on queue.Methods inherited from class com.amazon.sqs.javamessaging.acknowledge.BulkSQSOperation
bulkAction
-
Constructor Details
-
RangedAcknowledger
-
-
Method Details
-
acknowledge
Acknowledges all the consumed messages as well as the previously consumed messages on the session via callingdeleteMessageBatchuntil all the messages are deleted.- Specified by:
acknowledgein interfaceAcknowledger- Parameters:
message- message to acknowledge.- Throws:
jakarta.jms.JMSException
-
notifyMessageReceived
Updates the internal queue for the consumed but not acknowledged messages if the message was not already on queue.- Specified by:
notifyMessageReceivedin interfaceAcknowledger- Parameters:
message- notify acknowledger message is received- Throws:
jakarta.jms.JMSException
-
getUnAckMessages
Returns the list of all consumed but not acknowledged messages.- Specified by:
getUnAckMessagesin interfaceAcknowledger
-
forgetUnAckMessages
public void forgetUnAckMessages()Clears the list of not acknowledged messages.- Specified by:
forgetUnAckMessagesin interfaceAcknowledger
-
action
Acknowledges up to 10 messages via callingdeleteMessageBatch.- Specified by:
actionin classBulkSQSOperation- Parameters:
queueUrl- queueUrl of the queue, which the receipt handles belongreceiptHandles- the list of handles, which is be used to (negative)acknowledge the messages.- Throws:
jakarta.jms.JMSException
-