title: Amazon AWS Worker does not delete messages from SQS queue
body: <p>As I understand it my AWS elastic beanstalk Workers subscribing to an SQS queue should automatically delete messages if I send a 200 OK header.</p>
  
  <blockquote>
    <p>A web application in a worker environment should only listen on the
    local host. When the web application in the worker environment returns
    a 200 OK response to acknowledge that it has received and successfully
    processed the request, the daemon sends a DeleteMessage call to the
    SQS queue so that the message will be deleted from the queue. (SQS
    automatically deletes messages that have been in a queue for longer
    than the configured RetentionPeriod.) If the application returns any
    response other than 200 OK, then Elastic Beanstalk waits to put the
    message back in the queue after the configured VisibilityTimeout
    period. If there is no response, then Elastic Beanstalk waits to put
    the message back in the queue after the InactivityTimeout period so
    that the message is available for another attempt at processing.</p>
  </blockquote>
  
  <p>But mine are not doing that. They are processing OK and saving the video they're encoding to the right S3 bucket. But they do not delete the queue item like they should.</p>
  
  <p>I have tried sending the header various ways including...</p>
  
  <pre><code>http_response_code(200);
  
  header("HTTP/1.1 200 OK");
  
  header("HTTP/1.1 200 OK", true, 200);
  </code></pre>
  
  <p>I have no output on the page but have tried calling ob_start(); at the start and ob_end_flush(); after sending the header, and even tried just doing the header right at the start before any processing. Nothing works and the messages remain in flight and get redelivered after their visibility timeout ends.</p>
  
  <p>I can't think of anything else to delete these messages - the worker (I think) only receives the message body so I can't even take matters into my own hands and delete the message by its handler using the API.</p>
  
  <p>Help!</p>
  
  <p>Thanks.</p>