Class NegativeAcknowledger
- java.lang.Object
-
- com.amazon.sqs.javamessaging.acknowledge.BulkSQSOperation
-
- com.amazon.sqs.javamessaging.acknowledge.NegativeAcknowledger
-
public class NegativeAcknowledger extends BulkSQSOperation
Used to negative acknowledge of group of messages.Negative acknowledge resets the visibility timeout of a message, so that the message can be immediately available to consume. This is mostly used on
recover
andclose
methods.Negative acknowledge can potentially cause duplicate deliveries.
-
-
Constructor Summary
Constructors Constructor Description NegativeAcknowledger(AmazonSQSMessagingClientWrapper amazonSQSClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action(String queueUrl, List<String> receiptHandles)
Action call block for negative acknowledge for the list of receipt handles.void
bulkAction(ArrayDeque<SQSMessageConsumerPrefetch.MessageManager> messageQueue, String queueUrl)
Bulk action for negative acknowledge on the list of messages of a specific queue.-
Methods inherited from class com.amazon.sqs.javamessaging.acknowledge.BulkSQSOperation
bulkAction
-
-
-
-
Constructor Detail
-
NegativeAcknowledger
public NegativeAcknowledger(AmazonSQSMessagingClientWrapper amazonSQSClient)
-
-
Method Detail
-
bulkAction
public void bulkAction(ArrayDeque<SQSMessageConsumerPrefetch.MessageManager> messageQueue, String queueUrl) throws javax.jms.JMSException
Bulk action for negative acknowledge on the list of messages of a specific queue.- Parameters:
messageQueue
- Container for the list of message managers.queueUrl
- The queueUrl of the messages, which they received from.- Throws:
javax.jms.JMSException
- Ifaction
throws.
-
action
public void action(String queueUrl, List<String> receiptHandles) throws javax.jms.JMSException
Action call block for negative acknowledge for the list of receipt handles. This action can be applied on multiple messages for the same queue.- Specified by:
action
in classBulkSQSOperation
- Parameters:
queueUrl
- The queueUrl of the queue, which the receipt handles belong.receiptHandles
- The list of handles, which is be used to negative acknowledge the messages via usingchangeMessageVisibilityBatch
.- Throws:
javax.jms.JMSException
- IfchangeMessageVisibilityBatch
throws.
-
-