<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Van Houten</title>
    <description>The latest articles on DEV Community by Daniel Van Houten (@daniel_vanhouten).</description>
    <link>https://dev.to/daniel_vanhouten</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4279408%2Fda7e7ad9-23c7-440c-8e60-a0815103da1b.png</url>
      <title>DEV Community: Daniel Van Houten</title>
      <link>https://dev.to/daniel_vanhouten</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daniel_vanhouten"/>
    <language>en</language>
    <item>
      <title>How to Redrive One Specific Message from an SQS DLQ</title>
      <dc:creator>Daniel Van Houten</dc:creator>
      <pubDate>Thu, 03 Dec 2026 01:15:14 +0000</pubDate>
      <link>https://dev.to/daniel_vanhouten/how-to-redrive-one-specific-message-from-an-sqs-dlq-3k20</link>
      <guid>https://dev.to/daniel_vanhouten/how-to-redrive-one-specific-message-from-an-sqs-dlq-3k20</guid>
      <description>&lt;p&gt;You just deployed the fix for a bug that dumped 8,000 failed jobs into your SQS dead-letter queue. Before you open the floodgates on all 8,000, you want to replay &lt;em&gt;one&lt;/em&gt; specific order to verify the fix actually works in production.&lt;/p&gt;

&lt;p&gt;Hit AWS's built-in &lt;strong&gt;Start DLQ redrive&lt;/strong&gt; button and you will immediately find the problem: &lt;code&gt;StartMessageMoveTask&lt;/code&gt; has no message-ID filter and no body filter. Setting its max rate to 1 message per second controls the &lt;em&gt;speed&lt;/em&gt;, not a limit of one message.&lt;/p&gt;

&lt;p&gt;To replay a single DLQ message safely, you have to do three separate calls: &lt;strong&gt;receive it, send a copy to the destination queue, and delete the original only after the send succeeds.&lt;/strong&gt; Because those are not one atomic move, your consumer still needs to handle duplicates safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Receive a small batch from the DLQ
&lt;/h2&gt;

&lt;p&gt;SQS cannot look up a message by ID. Pull a small batch with a 5-minute visibility timeout (&lt;code&gt;300&lt;/code&gt; seconds) so you have time to inspect and verify the payload before the receipt handle expires:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;DLQ_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://sqs.us-east-1.amazonaws.com/123456789012/orders-dlq"&lt;/span&gt;
&lt;span class="nv"&gt;DESTINATION_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://sqs.us-east-1.amazonaws.com/123456789012/orders"&lt;/span&gt;

aws sqs receive-message \
  --queue-url &lt;span class="s2"&gt;"$DLQ_URL"&lt;/span&gt; \
  --max-number-of-messages 10 \
  --wait-time-seconds 20 \
  --visibility-timeout 300 \
  --message-attribute-names All \
  --message-system-attribute-names All \
  --output json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; dlq-batch.json

jq &lt;span class="s1"&gt;'.Messages[]? | {MessageId, Body, MessageAttributes}'&lt;/span&gt; dlq-batch.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the body to confirm the right order or business ID, then copy the &lt;code&gt;MessageId&lt;/code&gt; from this batch (not from an old producer log—the DLQ message ID is what you received here). If your target isn't in the first 10 messages, see &lt;a href="https://tarmac.vantixsoftware.com/docs/search-sqs-queue" rel="noopener noreferrer"&gt;How to Search an SQS Queue&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Build a send payload for that exact message
&lt;/h2&gt;

&lt;p&gt;This &lt;code&gt;jq&lt;/code&gt; command works on &lt;strong&gt;standard queues&lt;/strong&gt; (with AWS CLI v2 and &lt;code&gt;jq&lt;/code&gt;). It fails loudly if your &lt;code&gt;TARGET_ID&lt;/code&gt; matches zero or multiple messages, so you don't accidentally send the wrong payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;TARGET_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"paste-the-message-id-from-this-batch"&lt;/span&gt;

jq -e --arg id &lt;span class="s2"&gt;"$TARGET_ID"&lt;/span&gt; --arg destination &lt;span class="s2"&gt;"$DESTINATION_URL"&lt;/span&gt; &lt;span class="s1"&gt;'
  [.Messages[]? | select(.MessageId == $id)]
  | if length == 1 then .[0] else error("Expected exactly one matching message") end
  | {
      QueueUrl: $destination,
      MessageBody: .Body,
      MessageAttributes: (.MessageAttributes // {})
    }
'&lt;/span&gt; dlq-batch.json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; retry-request.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This preserves the message body and custom &lt;code&gt;MessageAttributes&lt;/code&gt; without copying SQS system metadata like the old receive count.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Send the copy first, then delete the original
&lt;/h2&gt;

&lt;p&gt;Glance at &lt;code&gt;retry-request.json&lt;/code&gt; first. Then run the send, and delete the original from the DLQ &lt;em&gt;only&lt;/em&gt; if &lt;code&gt;send-message&lt;/code&gt; exits cleanly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; aws sqs send-message \
  --cli-input-json file://retry-request.json \
  --cli-binary-format base64 \
  --output json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; retry-result.json&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="nv"&gt;RECEIPT_HANDLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;jq -er --arg id &lt;span class="s2"&gt;"$TARGET_ID"&lt;/span&gt; &lt;span class="s1"&gt;'
    [.Messages[]? | select(.MessageId == $id)]
    | if length == 1 then .[0].ReceiptHandle
      else error("Expected exactly one matching message") end
  '&lt;/span&gt; dlq-batch.json&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
  aws sqs delete-message \
    --queue-url &lt;span class="s2"&gt;"$DLQ_URL"&lt;/span&gt; \
    --receipt-handle &lt;span class="s2"&gt;"$RECEIPT_HANDLE"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two quick edge cases to watch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If the send succeeds but the delete fails&lt;/strong&gt;, you now have a copy in both queues. Fix the delete—don't re-run the send blindly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If your 5-minute receipt handle expires before you delete&lt;/strong&gt;, receive the original again to get a fresh handle. Calling &lt;code&gt;delete-message&lt;/code&gt; with an old handle can report success without actually removing it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every other message from your batch becomes visible on the DLQ again when the 5 minutes are up. Check your consumer logs to confirm the job actually succeeded—&lt;code&gt;send-message&lt;/code&gt; only confirms SQS accepted the copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick heads-up for FIFO queues
&lt;/h2&gt;

&lt;p&gt;Don't run the standard-queue JSON above unchanged on a FIFO destination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You must include the original &lt;code&gt;MessageGroupId&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pass a fresh, explicit &lt;code&gt;MessageDeduplicationId&lt;/code&gt; for this retry (and reuse that same ID only if you retry the exact same send after a network timeout). On queues with content-based deduplication, omitting an explicit ID can cause SQS to silently drop the retry within the 5-minute deduplication window.&lt;/li&gt;
&lt;li&gt;Replaying a message does not put it back in its original sequence position—check whether newer events already changed the underlying state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Skipping the shell scripts with Tarmac
&lt;/h2&gt;

&lt;p&gt;Doing this bash-and-&lt;code&gt;jq&lt;/code&gt; dance under incident pressure is a big reason I built &lt;a href="https://tarmac.vantixsoftware.com/" rel="noopener noreferrer"&gt;Tarmac&lt;/a&gt; (a native SQS desktop client for macOS and Windows).&lt;/p&gt;

&lt;p&gt;You fetch DLQ messages once into a local cache, search them by full text or JSON fields, inspect the exact payload, and right-click -&amp;gt; &lt;strong&gt;Stage send&lt;/strong&gt; back to the source queue (with &lt;strong&gt;Delete originals after successful send&lt;/strong&gt; checked). Everything goes into a &lt;strong&gt;Staged&lt;/strong&gt; batch so you can double-check that you are touching &lt;em&gt;one&lt;/em&gt; message before clicking &lt;strong&gt;Publish Actions&lt;/strong&gt;. Tarmac sends first, deletes only after AWS confirms, and carries FIFO group and dedup IDs.&lt;/p&gt;

&lt;p&gt;Viewing and local search are free with no account required; staged mutations like selective redrive are part of Tarmac Pro. You can &lt;a href="https://tarmac.vantixsoftware.com/download" rel="noopener noreferrer"&gt;download Tarmac here&lt;/a&gt; or read the full &lt;a href="https://tarmac.vantixsoftware.com/docs/dlq-redrive" rel="noopener noreferrer"&gt;DLQ redrive workflow&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published in the &lt;a href="https://tarmac.vantixsoftware.com/docs/redrive-one-specific-dlq-message" rel="noopener noreferrer"&gt;Tarmac documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>sqs</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How to View SQS Messages Without Deleting Them</title>
      <dc:creator>Daniel Van Houten</dc:creator>
      <pubDate>Thu, 03 Dec 2026 01:06:56 +0000</pubDate>
      <link>https://dev.to/daniel_vanhouten/how-to-view-sqs-messages-without-deleting-them-4cp3</link>
      <guid>https://dev.to/daniel_vanhouten/how-to-view-sqs-messages-without-deleting-them-4cp3</guid>
      <description>&lt;p&gt;Whenever something goes sideways in an SQS-backed system, the first instinct is always: &lt;em&gt;"Let me just look at a couple of messages to see what the payload looks like."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Good news first: &lt;strong&gt;viewing an SQS message does not delete it.&lt;/strong&gt; SQS only removes a message when someone explicitly calls &lt;code&gt;DeleteMessage&lt;/code&gt; with its receipt handle, or when it ages past the queue's retention period.&lt;/p&gt;

&lt;p&gt;The catch is that &lt;strong&gt;SQS has no true read-only peek.&lt;/strong&gt; To read a message, you have to receive it—and receiving changes queue state in three ways that are easy to forget during an incident.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when you "just look"
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Real consumers have to wait.&lt;/strong&gt; While you hold the message, it is invisible for the visibility timeout. Workers and Lambda triggers cannot touch it until the timer expires or you release it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You bump &lt;code&gt;ApproximateReceiveCount&lt;/code&gt;.&lt;/strong&gt; SQS treats every receive without a delete as a failed attempt. Peek at the same message a few times on a queue with a low &lt;code&gt;maxReceiveCount&lt;/code&gt;, and you can accidentally shove a healthy message straight into the dead-letter queue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIFO message groups pause.&lt;/strong&gt; Holding one message on a FIFO queue blocks every other message in that same &lt;code&gt;MessageGroupId&lt;/code&gt; until you let it go.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The safe habit is simple: use a short visibility timeout, watch the receive count, and release the messages back to the queue as soon as you grab the payload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1: The AWS Console
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your queue in the SQS Console.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Send and receive messages&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Poll for messages&lt;/strong&gt; and open a message to inspect its body and attributes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As long as you do not click &lt;strong&gt;Delete&lt;/strong&gt;, the messages stay on the queue and become visible again when the queue's default visibility timeout runs out. The list also shows each message's receive count so you know if you are getting close to the DLQ threshold.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: AWS CLI + &lt;code&gt;jq&lt;/code&gt; (with an immediate release)
&lt;/h2&gt;

&lt;p&gt;If you want tighter control—and don't want messages sitting hidden for a long queue default timeout—receive up to 10 messages with a 60-second visibility timeout and save them locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;QUEUE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://sqs.us-east-1.amazonaws.com/123456789012/orders"&lt;/span&gt;

aws sqs receive-message \
  --queue-url &lt;span class="s2"&gt;"$QUEUE_URL"&lt;/span&gt; \
  --max-number-of-messages 10 \
  --visibility-timeout 60 \
  --message-system-attribute-names ApproximateReceiveCount SentTimestamp \
  --message-attribute-names All \
  --output json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; peek.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the payloads locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jq &lt;span class="s1"&gt;'.Messages[]? | {MessageId, ReceiveCount: .Attributes.ApproximateReceiveCount, Body}'&lt;/span&gt; peek.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then release them right away so your real consumers do not wait out the 60 seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jq -r &lt;span class="s1"&gt;'.Messages[]?.ReceiptHandle'&lt;/span&gt; peek.json &lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r handle&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    aws sqs change-message-visibility \
      --queue-url &lt;span class="s2"&gt;"$QUEUE_URL"&lt;/span&gt; \
      --receipt-handle &lt;span class="s2"&gt;"$handle"&lt;/span&gt; \
      --visibility-timeout 0
  &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep in mind that one &lt;code&gt;receive-message&lt;/code&gt; call returns at most 10 messages, and standard queues do not guarantee order. If you need to hunt through a deeper queue, see &lt;a href="https://tarmac.vantixsoftware.com/docs/search-sqs-queue" rel="noopener noreferrer"&gt;How to Search an SQS Queue for a Message&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 3: A desktop client that caches locally
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://tarmac.vantixsoftware.com/" rel="noopener noreferrer"&gt;Tarmac&lt;/a&gt; (macOS and Windows) mostly because I got tired of writing throwaway &lt;code&gt;jq&lt;/code&gt; scripts every time I needed to inspect a queue without risking an accidental delete in the AWS Console.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Tarmac Free&lt;/strong&gt;, delete isn't even enabled—it only receives, inspects, and releases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select a queue, set &lt;strong&gt;Count&lt;/strong&gt; and &lt;strong&gt;Visibility (min)&lt;/strong&gt;, and click &lt;strong&gt;Fetch Messages&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click any message to read formatted JSON, message attributes, receive count, and timestamps.&lt;/li&gt;
&lt;li&gt;Everything you fetch stays in a local cache on your machine, so you can search and re-read payloads later without hitting SQS again. When you quit or clear the cache, Tarmac releases any messages it still holds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you just want to watch live traffic roll in, &lt;strong&gt;Live Tail&lt;/strong&gt; grabs one message per tick with a 1-second visibility timeout and stops automatically if a message gets close to the queue's redrive limit. (Deletes and redrives are Pro features, and they are always staged for review before anything gets published.)&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published in the &lt;a href="https://tarmac.vantixsoftware.com/docs/view-sqs-messages-without-deleting" rel="noopener noreferrer"&gt;Tarmac documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>sqs</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SQS Messages Stuck in Flight? Find the Cause and Get Them Moving</title>
      <dc:creator>Daniel Van Houten</dc:creator>
      <pubDate>Thu, 03 Dec 2026 01:05:52 +0000</pubDate>
      <link>https://dev.to/daniel_vanhouten/sqs-messages-stuck-in-flight-find-the-cause-and-get-them-moving-4idi</link>
      <guid>https://dev.to/daniel_vanhouten/sqs-messages-stuck-in-flight-find-the-cause-and-get-them-moving-4idi</guid>
      <description>&lt;p&gt;Few things ruin an afternoon faster than an SQS queue showing messages in flight while your workers sit there swearing they have nothing to do. Somewhere upstream, a real customer order is stuck in limbo.&lt;/p&gt;

&lt;p&gt;In SQS, a message is &lt;strong&gt;in flight&lt;/strong&gt; from the moment a consumer calls &lt;code&gt;ReceiveMessage&lt;/code&gt; until it gets deleted or its visibility timeout expires. That count does not prove a worker is actively processing anything. The worker could be waiting on a slow downstream API, stuck in a retry loop, or already dead.&lt;/p&gt;

&lt;p&gt;Here is the fastest way to track down why messages are stuck and get them moving again.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Check the actual queue counts first
&lt;/h2&gt;

&lt;p&gt;Before guessing, pull the queue attributes with the AWS CLI. This reads metadata only and does not receive or disturb any messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;QUEUE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://sqs.us-east-1.amazonaws.com/123456789012/orders"&lt;/span&gt;

aws sqs get-queue-attributes \
  --queue-url &lt;span class="s2"&gt;"$QUEUE_URL"&lt;/span&gt; \
  --attribute-names \
    ApproximateNumberOfMessages \
    ApproximateNumberOfMessagesNotVisible \
    ApproximateNumberOfMessagesDelayed \
    VisibilityTimeout \
    RedrivePolicy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quick quirk to remember: CloudWatch calls visible messages &lt;code&gt;ApproximateNumberOfMessagesVisible&lt;/code&gt;, while the SQS API drops &lt;code&gt;Visible&lt;/code&gt; and just calls it &lt;code&gt;ApproximateNumberOfMessages&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Watch &lt;code&gt;ApproximateNumberOfMessagesNotVisible&lt;/code&gt; over a few minutes rather than a single snapshot. Also check &lt;code&gt;ApproximateNumberOfMessagesDelayed&lt;/code&gt;—delayed messages are waiting on a delivery timer, not stuck on a worker.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Check the three worker events
&lt;/h2&gt;

&lt;p&gt;Look in your worker logs for one specific business ID and check three milestones:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Did a worker receive it?&lt;/li&gt;
&lt;li&gt;Did the job finish?&lt;/li&gt;
&lt;li&gt;Did &lt;code&gt;DeleteMessage&lt;/code&gt; succeed?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Whichever step is missing usually points straight to the bug:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Received, then silence:&lt;/strong&gt; The process crashed, hit an OOM kill, or is blocked on an external request with no timeout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Job finished, no delete:&lt;/strong&gt; Check IAM permissions (&lt;code&gt;sqs:DeleteMessage&lt;/code&gt;), swallowed exceptions, or stale receipt handles. Every receive generates a new receipt handle, and AWS notes that calling &lt;code&gt;DeleteMessage&lt;/code&gt; with an expired handle can return success without actually removing the message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same job running over and over:&lt;/strong&gt; Your visibility timeout is shorter than the job takes, so another worker picks it up before the first one finishes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember: SQS does not care that your app logged &lt;code&gt;"Done!"&lt;/code&gt;. If nobody calls &lt;code&gt;DeleteMessage&lt;/code&gt; (or uses an integration that does it for you), the message stays in flight until the timer runs out.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Look at the visibility timer (and your own debugging tools)
&lt;/h2&gt;

&lt;p&gt;When a worker dies, SQS makes its message visible again once &lt;code&gt;VisibilityTimeout&lt;/code&gt; ends. If that timeout is set to 30 minutes, a normal crash looks like a frozen queue. Worse, a background heartbeat timer that keeps extending visibility after the actual job stalled can pin a message for up to 12 hours (the hard SQS ceiling from initial receive).&lt;/p&gt;

&lt;p&gt;One trap that catches teams all the time: &lt;strong&gt;your own debugging session holds messages in flight too.&lt;/strong&gt; Polling in the AWS Console calls &lt;code&gt;ReceiveMessage&lt;/code&gt;. So do desktop clients like &lt;a href="https://tarmac.vantixsoftware.com/" rel="noopener noreferrer"&gt;Tarmac&lt;/a&gt; (which holds fetched messages for its Visibility setting and releases them when you quit). Always check whether a teammate has the queue open in a console tab. See &lt;a href="https://tarmac.vantixsoftware.com/docs/view-sqs-messages-without-deleting" rel="noopener noreferrer"&gt;How to View SQS Messages Without Deleting Them&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Check the two classic AWS traps: FIFO and Lambda
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FIFO queues:&lt;/strong&gt; One slow message blocks &lt;em&gt;every&lt;/em&gt; later message with the same &lt;code&gt;MessageGroupId&lt;/code&gt; until it is deleted or visible again. Other groups keep moving, so the queue looks half-alive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lambda triggers:&lt;/strong&gt; If a Lambda invocation fails, the &lt;em&gt;entire batch&lt;/em&gt; stays hidden until the visibility timeout ends, even the messages that succeeded. Turn on &lt;code&gt;ReportBatchItemFailures&lt;/code&gt; so Lambda only returns the failed message IDs. Also set the queue's visibility timeout to at least &lt;strong&gt;6x your Lambda timeout&lt;/strong&gt; (plus &lt;code&gt;MaximumBatchingWindowInSeconds&lt;/code&gt; if you use a batching window).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In-flight quota:&lt;/strong&gt; Standard queues top out around 120,000 in-flight messages. Once you hit that ceiling, short polling throws &lt;code&gt;OverLimit&lt;/code&gt; and long polling quietly returns nothing until counts drop.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Can you peek at or release an in-flight message?
&lt;/h2&gt;

&lt;p&gt;You cannot view an in-flight message from another client—SQS simply will not return it until it becomes visible again. (And avoid &lt;code&gt;PurgeQueue&lt;/code&gt; unless it is a disposable test queue; it wipes &lt;em&gt;everything&lt;/em&gt;, visible and in flight, with no undo.)&lt;/p&gt;

&lt;p&gt;If you &lt;em&gt;do&lt;/em&gt; have the current receipt handle from the worker holding the message, you can make it visible immediately—just make sure that worker is no longer processing it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;RECEIPT_HANDLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"paste-the-current-receipt-handle-here"&lt;/span&gt;

aws sqs change-message-visibility \
  --queue-url &lt;span class="s2"&gt;"$QUEUE_URL"&lt;/span&gt; \
  --receipt-handle &lt;span class="s2"&gt;"$RECEIPT_HANDLE"&lt;/span&gt; \
  --visibility-timeout 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the fix is out, trace one order or job ID all the way through receive, work, and delete to confirm the queue drains cleanly. If the broken messages already landed in a dead-letter queue, test one message first instead of replaying the whole backlog—here is &lt;a href="https://tarmac.vantixsoftware.com/docs/redrive-one-specific-dlq-message" rel="noopener noreferrer"&gt;how to redrive one specific DLQ message&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published in the &lt;a href="https://tarmac.vantixsoftware.com/docs/sqs-messages-stuck-in-flight" rel="noopener noreferrer"&gt;Tarmac documentation&lt;/a&gt; (includes full AWS reference links and edge-case details).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>sqs</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
