SQS Messages Not Deleting

EngineerBetter_DJ picture EngineerBetter_DJ · Apr 17, 2012 · Viewed 7.1k times · Source

I have a small set of messages in an SQS queue, that are not deleted even though a deletion request sent to the AWS endpoint returns with a 200 response. The messages are processed by my application fine, and the deletion request is sent fine too.

I'm using the Java AWS SDK 1.3.6.

Has anyone else experienced this problem?

Answer

EngineerBetter_DJ picture EngineerBetter_DJ · Apr 18, 2012

Whoops - the queue was accidentally set to defaultVisibilityTimeout=0. Changing this to a positive value fixed the problem.

This still raises a few questions though:

  1. Why did this only affect some messages? Perhaps some took longer to process?
  2. Why did Amazon return a 200 for delete when the messages weren't being deleted?
  3. Was the deletion failing because it fell outside of the 0-second window (in which case why did any deletion requests succeed?), or did they fail because another consumer had picked them up by the time the deletion request was received?