title: SQS messages remain in flight though it has been processed by lambda
body: <p>SQS messages get processed successfully by lambda. Here is the code that processes and then executes the callback:</p>
  
  <pre><code> exports.handler = function(event, context, callback) {
     handleSQSMessages(context,event, function () {
      const response = {
          statusCode: 200,
          body: JSON.stringify({
              message: 'SQS event processed.',
              input: event,
          }),
      };
      console.log ("OK DONE");
      callback(null, response);
  
  function handleSQSMessages(context, messages, callback) {
   messages = messages.Records;
   if (messages &amp;&amp; messages.length &gt; 0) {
     messages.forEach(function(message) {
         console.log(message);
         //...
  </code></pre>
  
  <p>I see that cloudwatch prints the "OK DONE" message. However, SQS puts messages 'in flight' (and it stays in flight forever). My understanding is that once a successful response is sent, the message will be automatically deleted. My visibility timer = 10 min</p>