public class RangedAcknowledger extends BulkSQSOperation implements Acknowledger
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 and Description |
|---|
RangedAcknowledger(AmazonSQSMessagingClientWrapper amazonSQSClient,
SQSSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(SQSMessage message)
Acknowledges all the consumed messages as well as the previously consumed
messages on the session via calling
deleteMessageBatch until
all the messages are deleted. |
void |
action(String queueUrl,
List<String> receiptHandles)
Acknowledges up to 10 messages via calling
deleteMessageBatch. |
void |
forgetUnAckMessages()
Clears the list of not acknowledged messages.
|
List<SQSMessageIdentifier> |
getUnAckMessages()
Returns the list of all consumed but not acknowledged messages.
|
void |
notifyMessageReceived(SQSMessage message)
Updates the internal queue for the consumed but not acknowledged
messages if the message was not already on queue.
|
bulkActionpublic RangedAcknowledger(AmazonSQSMessagingClientWrapper amazonSQSClient, SQSSession session)
public void acknowledge(SQSMessage message) throws javax.jms.JMSException
deleteMessageBatch until
all the messages are deleted.acknowledge in interface Acknowledgermessage - message to acknowledge.javax.jms.JMSExceptionpublic void notifyMessageReceived(SQSMessage message) throws javax.jms.JMSException
notifyMessageReceived in interface Acknowledgermessage - notify acknowledger message is receivedjavax.jms.JMSExceptionpublic List<SQSMessageIdentifier> getUnAckMessages()
getUnAckMessages in interface Acknowledgerpublic void forgetUnAckMessages()
forgetUnAckMessages in interface Acknowledgerpublic void action(String queueUrl, List<String> receiptHandles) throws javax.jms.JMSException
deleteMessageBatch.action in class BulkSQSOperationqueueUrl - queueUrl of the queue, which the receipt handles belongreceiptHandles - the list of handles, which is be used to (negative)acknowledge
the messages.javax.jms.JMSExceptionCopyright © 2022. All rights reserved.