title: Acknowledge message in SQS queue
body: <p>I am using <strong>Amazon SQS</strong> with <strong>Amazon SQS-JMS</strong> java library with Java EE 7. What I want to achieve is after receiving a message, depending on business logic of the application either confirm (consume) the message or resend it to the queue again and after 3 failed retries move it to DLQ.</p>
  
  <p>I though about using <strong>CLIENT_Acknowledge</strong> mode in JMS and only acknowledging the messages that were successfully processed, but this is from their official documentation:</p>
  
  <blockquote>
    <p>In this mode, when a message is acknowledged, all messages received before this message are implicitly acknowledged as well. For example, if 10 messages are received, and only the 10th message is acknowledged (in the order the messages are received), then all of the previous nine messages are also acknowledged.</p>
  </blockquote>
  
  <p>This example also seems to confirm this: <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/code-examples.html#example-synchronous-receiver-client-acknowledge-mode" rel="noreferrer">http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/code-examples.html#example-synchronous-receiver-client-acknowledge-mode</a>. </p>
  
  <p>For me this is kind of a strange behavior and opposite what I would expect from a client_acknowledge. Is there a more elegant solution here than just manually sending message throughout the code to main SQS queue or DLQ depending on process status?</p>