Amazon SQS — Managed Message Queue

You are an expert in Amazon SQS (Simple Queue Service), the fully managed message queuing service. You help developers build decoupled, event-driven architectures using standard queues (at-least-once, best-effort ordering) and FIFO queues (exactly-once, ordered), dead-letter queues for failed messages, and Lambda triggers for serverless processing — scaling from zero to millions of messages per second.

25 stars

Best use case

Amazon SQS — Managed Message Queue is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

You are an expert in Amazon SQS (Simple Queue Service), the fully managed message queuing service. You help developers build decoupled, event-driven architectures using standard queues (at-least-once, best-effort ordering) and FIFO queues (exactly-once, ordered), dead-letter queues for failed messages, and Lambda triggers for serverless processing — scaling from zero to millions of messages per second.

Teams using Amazon SQS — Managed Message Queue should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sqs/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/TerminalSkills/skills/sqs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sqs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Amazon SQS — Managed Message Queue Compares

Feature / AgentAmazon SQS — Managed Message QueueStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

You are an expert in Amazon SQS (Simple Queue Service), the fully managed message queuing service. You help developers build decoupled, event-driven architectures using standard queues (at-least-once, best-effort ordering) and FIFO queues (exactly-once, ordered), dead-letter queues for failed messages, and Lambda triggers for serverless processing — scaling from zero to millions of messages per second.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Amazon SQS — Managed Message Queue

You are an expert in Amazon SQS (Simple Queue Service), the fully managed message queuing service. You help developers build decoupled, event-driven architectures using standard queues (at-least-once, best-effort ordering) and FIFO queues (exactly-once, ordered), dead-letter queues for failed messages, and Lambda triggers for serverless processing — scaling from zero to millions of messages per second.

## Core Capabilities

### Send and Receive Messages

```typescript
import { SQSClient, SendMessageCommand, ReceiveMessageCommand, DeleteMessageCommand } from "@aws-sdk/client-sqs";

const sqs = new SQSClient({ region: "us-east-1" });
const QUEUE_URL = process.env.SQS_QUEUE_URL!;

// Send message
async function sendOrder(order: { id: string; items: any[]; total: number }) {
  await sqs.send(new SendMessageCommand({
    QueueUrl: QUEUE_URL,
    MessageBody: JSON.stringify(order),
    MessageAttributes: {
      OrderType: { DataType: "String", StringValue: order.total > 1000 ? "high-value" : "standard" },
    },
    DelaySeconds: 0,
  }));
}

// FIFO queue: send with deduplication and grouping
async function sendFifoMessage(userId: string, event: any) {
  await sqs.send(new SendMessageCommand({
    QueueUrl: FIFO_QUEUE_URL,
    MessageBody: JSON.stringify(event),
    MessageGroupId: userId,               // Messages for same user processed in order
    MessageDeduplicationId: event.id,     // Prevents duplicate processing within 5 min
  }));
}

// Receive and process (polling)
async function pollMessages() {
  const response = await sqs.send(new ReceiveMessageCommand({
    QueueUrl: QUEUE_URL,
    MaxNumberOfMessages: 10,
    WaitTimeSeconds: 20,                  // Long polling (reduces empty responses)
    VisibilityTimeout: 60,                // 60s to process before message becomes visible again
    MessageAttributeNames: ["All"],
  }));

  for (const message of response.Messages || []) {
    try {
      const order = JSON.parse(message.Body!);
      await processOrder(order);

      // Delete after successful processing
      await sqs.send(new DeleteMessageCommand({
        QueueUrl: QUEUE_URL,
        ReceiptHandle: message.ReceiptHandle!,
      }));
    } catch (error) {
      console.error(`Failed to process ${message.MessageId}:`, error);
      // Message becomes visible again after VisibilityTimeout
    }
  }
}
```

### Lambda Trigger

```yaml
# SAM template — SQS → Lambda
Resources:
  OrderProcessor:
    Type: AWS::Serverless::Function
    Properties:
      Handler: processor.handler
      Runtime: nodejs20.x
      Events:
        SQSEvent:
          Type: SQS
          Properties:
            Queue: !GetAtt OrderQueue.Arn
            BatchSize: 10
            MaximumBatchingWindowInSeconds: 5
            FunctionResponseTypes:
              - ReportBatchItemFailures     # Partial batch failure support

  OrderQueue:
    Type: AWS::SQS::Queue
    Properties:
      VisibilityTimeout: 300
      RedrivePolicy:
        deadLetterTargetArn: !GetAtt DeadLetterQueue.Arn
        maxReceiveCount: 3                 # After 3 failures → DLQ

  DeadLetterQueue:
    Type: AWS::SQS::Queue
    Properties:
      MessageRetentionPeriod: 1209600     # 14 days
```

```typescript
// Lambda handler with partial batch failure reporting
export async function handler(event: SQSEvent) {
  const batchItemFailures: { itemIdentifier: string }[] = [];

  for (const record of event.Records) {
    try {
      const order = JSON.parse(record.body);
      await processOrder(order);
    } catch (error) {
      batchItemFailures.push({ itemIdentifier: record.messageId });
    }
  }

  return { batchItemFailures };           // Only failed messages retry
}
```

## Installation

```bash
npm install @aws-sdk/client-sqs
```

## Best Practices

1. **Long polling** — Set `WaitTimeSeconds: 20` to reduce empty receives and API costs
2. **Dead-letter queues** — Configure DLQ with `maxReceiveCount: 3-5`; investigate failed messages, don't lose them
3. **FIFO for ordering** — Use FIFO queues when message order matters; MessageGroupId determines ordering scope
4. **Visibility timeout** — Set to 6x your processing time; prevents premature redelivery
5. **Batch operations** — Send/receive/delete in batches of 10; reduces API calls and costs
6. **Partial batch failures** — Return `batchItemFailures` from Lambda; only failed messages retry
7. **Idempotent consumers** — SQS guarantees at-least-once; design processors to handle duplicate messages safely
8. **Message attributes** — Use message attributes for routing/filtering; avoid parsing body just for routing

Related Skills

sqs-queue-setup

25
from ComeOnOliver/skillshub

Sqs Queue Setup - Auto-activating skill for AWS Skills. Triggers on: sqs queue setup, sqs queue setup Part of the AWS Skills skill category.

rabbitmq-queue-setup

25
from ComeOnOliver/skillshub

Rabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.

commit-message-formatter

25
from ComeOnOliver/skillshub

Commit Message Formatter - Auto-activating skill for DevOps Basics. Triggers on: commit message formatter, commit message formatter Part of the DevOps Basics skill category.

cloud-tasks-queue-setup

25
from ComeOnOliver/skillshub

Cloud Tasks Queue Setup - Auto-activating skill for GCP Skills. Triggers on: cloud tasks queue setup, cloud tasks queue setup Part of the GCP Skills skill category.

azure-storage-queue-ts

25
from ComeOnOliver/skillshub

Azure Queue Storage JavaScript/TypeScript SDK (@azure/storage-queue) for message queue operations. Use for sending, receiving, peeking, and deleting messages in queues. Supports visibility timeout, message encoding, and batch operations. Triggers: "queue storage", "@azure/storage-queue", "QueueServiceClient", "QueueClient", "send message", "receive message", "dequeue", "visibility timeout".

azure-storage-queue-py

25
from ComeOnOliver/skillshub

Azure Queue Storage SDK for Python. Use for reliable message queuing, task distribution, and asynchronous processing. Triggers: "queue storage", "QueueServiceClient", "QueueClient", "message queue", "dequeue".

commit-message-generator

25
from ComeOnOliver/skillshub

Generate appropriate commit messages based on Git diffs

commit-message

25
from ComeOnOliver/skillshub

Format git commit messages combining Conventional Commits summary lines with Linux kernel-style bodies. Use when writing, reviewing, or formatting commit messages.

Commit Message Skill

25
from ComeOnOliver/skillshub

Generate consistent, informative commit messages following the Conventional Commits specification.

MessagePack — Efficient Binary Serialization

25
from ComeOnOliver/skillshub

You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.

Job Queue

25
from ComeOnOliver/skillshub

## Overview

Amazon Q (formerly Fig) — Terminal Autocomplete & CLI Tools

25
from ComeOnOliver/skillshub

## Overview