sqs
Amazon SQS managed message queue service. Covers standard and FIFO queues, dead-letter queues, and integration patterns. Use for AWS-native serverless and microservices architectures. USE WHEN: user mentions "sqs", "aws queues", "fifo queue", "lambda trigger", "sns to sqs", asks about "aws messaging", "serverless queues", "standard queue", "visibility timeout" DO NOT USE FOR: event streaming - use `kafka` or AWS Kinesis; Azure-native - use `azure-service-bus`; GCP-native - use `google-pubsub`; on-premise - use `rabbitmq` or `activemq`; complex routing - use `rabbitmq`
What this skill does
# Amazon SQS Core Knowledge
> **Full Reference**: See [advanced.md](advanced.md) for Java/Python/Go producers, Spring Cloud AWS consumers, Lambda integration, IAM policies, and CloudWatch monitoring.
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `sqs` for comprehensive documentation.
## Quick Start (LocalStack)
```yaml
# docker-compose.yml
services:
localstack:
image: localstack/localstack
ports:
- "4566:4566"
environment:
- SERVICES=sqs
- DEFAULT_REGION=us-east-1
volumes:
- localstack_data:/var/lib/localstack
volumes:
localstack_data:
```
```bash
# Create queue
aws --endpoint-url=http://localhost:4566 sqs create-queue \
--queue-name orders-queue
# Create FIFO queue
aws --endpoint-url=http://localhost:4566 sqs create-queue \
--queue-name orders-queue.fifo \
--attributes FifoQueue=true,ContentBasedDeduplication=true
```
## Core Concepts
| Concept | Description |
|---------|-------------|
| **Standard Queue** | At-least-once, best-effort ordering |
| **FIFO Queue** | Exactly-once, strict ordering |
| **Visibility Timeout** | Message lock period |
| **Dead Letter Queue** | Failed message destination |
| **Long Polling** | Efficient message retrieval |
| **Message Groups** | FIFO ordering within group |
## Queue Types Comparison
| Feature | Standard | FIFO |
|---------|----------|------|
| Throughput | Unlimited | 300 msg/s (3000 with batching) |
| Ordering | Best-effort | Strict (per group) |
| Delivery | At-least-once | Exactly-once |
| Deduplication | None | 5-minute window |
## Producer Pattern (Node.js)
```typescript
import { SQSClient, SendMessageCommand, SendMessageBatchCommand } from '@aws-sdk/client-sqs';
const client = new SQSClient({
region: 'us-east-1',
// For LocalStack: endpoint: 'http://localhost:4566',
});
const queueUrl = 'https://sqs.us-east-1.amazonaws.com/123456789/orders-queue';
// Send single message
await client.send(new SendMessageCommand({
QueueUrl: queueUrl,
MessageBody: JSON.stringify(order),
MessageAttributes: {
'OrderType': {
DataType: 'String',
StringValue: order.type,
},
'CorrelationId': {
DataType: 'String',
StringValue: correlationId,
},
},
DelaySeconds: 0,
}));
// Send batch (up to 10)
await client.send(new SendMessageBatchCommand({
QueueUrl: queueUrl,
Entries: orders.map((order, index) => ({
Id: `msg-${index}`,
MessageBody: JSON.stringify(order),
MessageAttributes: {
'OrderType': { DataType: 'String', StringValue: order.type },
},
})),
}));
// FIFO queue
const fifoQueueUrl = 'https://sqs.us-east-1.amazonaws.com/123456789/orders-queue.fifo';
await client.send(new SendMessageCommand({
QueueUrl: fifoQueueUrl,
MessageBody: JSON.stringify(order),
MessageGroupId: order.customerId, // Required for FIFO
MessageDeduplicationId: order.orderId, // Or use ContentBasedDeduplication
}));
```
## Consumer Pattern (Node.js)
```typescript
import { SQSClient, ReceiveMessageCommand, DeleteMessageCommand } from '@aws-sdk/client-sqs';
const client = new SQSClient({ region: 'us-east-1' });
async function pollMessages() {
while (true) {
const response = await client.send(new ReceiveMessageCommand({
QueueUrl: queueUrl,
MaxNumberOfMessages: 10,
WaitTimeSeconds: 20, // Long polling
VisibilityTimeout: 30,
MessageAttributeNames: ['All'],
AttributeNames: ['All'],
}));
if (!response.Messages) continue;
for (const message of response.Messages) {
try {
const order = JSON.parse(message.Body!);
await processOrder(order);
// Delete on success
await client.send(new DeleteMessageCommand({
QueueUrl: queueUrl,
ReceiptHandle: message.ReceiptHandle!,
}));
} catch (error) {
// Message will return to queue after visibility timeout
console.error('Processing failed:', error);
}
}
}
}
```
## Dead Letter Queue
```typescript
// Create DLQ
await client.send(new CreateQueueCommand({
QueueName: 'orders-dlq',
}));
// Main queue with DLQ
await client.send(new CreateQueueCommand({
QueueName: 'orders-queue',
Attributes: {
RedrivePolicy: JSON.stringify({
deadLetterTargetArn: 'arn:aws:sqs:us-east-1:123456789:orders-dlq',
maxReceiveCount: '3',
}),
VisibilityTimeout: '30',
MessageRetentionPeriod: '1209600', // 14 days
},
}));
```
```hcl
# Terraform
resource "aws_sqs_queue" "orders_dlq" {
name = "orders-dlq"
message_retention_seconds = 1209600
}
resource "aws_sqs_queue" "orders" {
name = "orders-queue"
visibility_timeout_seconds = 30
message_retention_seconds = 1209600
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.orders_dlq.arn
maxReceiveCount = 3
})
}
```
## Lambda Integration
```typescript
// Lambda handler
export const handler = async (event: SQSEvent): Promise<SQSBatchResponse> => {
const batchItemFailures: SQSBatchItemFailure[] = [];
for (const record of event.Records) {
try {
const order = JSON.parse(record.body);
await processOrder(order);
} catch (error) {
// Report partial batch failure
batchItemFailures.push({ itemIdentifier: record.messageId });
}
}
return { batchItemFailures };
};
```
```yaml
# serverless.yml
functions:
orderProcessor:
handler: handler.handler
events:
- sqs:
arn: !GetAtt OrdersQueue.Arn
batchSize: 10
functionResponseType: ReportBatchItemFailures
```
## When NOT to Use This Skill
Use alternative messaging solutions when:
- Event streaming with replay - Use Kinesis or Kafka
- Cross-cloud or hybrid cloud - Use Kafka, RabbitMQ, or Pulsar
- Complex routing patterns - RabbitMQ provides better routing
- Message ordering across all messages - FIFO queues have throughput limits
- Real-time low latency (<10ms) - Use Redis or NATS
- On-premise deployment - Use RabbitMQ or ActiveMQ
- Message size >256KB - Use S3 with SQS Extended Client
## Anti-Patterns
| Anti-Pattern | Why It's Bad | Solution |
|--------------|--------------|----------|
| Short polling (WaitTime=0) | Wasteful API calls, higher cost | Use long polling (WaitTimeSeconds=20) |
| No DLQ configured | Failed messages lost | Always configure dead letter queue |
| Visibility timeout too short | Duplicate processing | Set timeout > max processing time |
| Visibility timeout too long | Slow failure recovery | Balance with processing time |
| Processing before delete | Message reprocessed on crash | Delete only after successful processing |
| FIFO for high throughput | Limited to 300 msg/s | Use Standard queue if ordering not critical |
| No batching | Higher latency and cost | Batch up to 10 messages per request |
| Polling in Lambda | Wasted invocations | Use Lambda event source mapping |
| No IAM policies | Security risk | Apply least privilege IAM policies |
## Quick Troubleshooting
| Issue | Likely Cause | Fix |
|-------|--------------|-----|
| Messages not appearing | Wrong queue URL or permissions | Verify URL and IAM permissions |
| Duplicate messages | Standard queue behavior or visibility timeout | Implement idempotent processing |
| Messages delayed | Delay seconds set or queue backlog | Check DelaySeconds, scale consumers |
| Messages in DLQ | Max receives exceeded | Check processing logic, increase retries |
| Visibility timeout errors | Message processing too slow | Extend visibility timeout |
| Throughput limited | FIFO queue limit | Use Standard queue or batch messages |
| High costs | Short polling or frequent sends | Use long polling, batch operations |
| Access denied | Missing IAM permissions | Add sqs:SendMessage/ReceiveMessage |
| Message size limit | Payload >256KB | Use SQS Extended Client with S3 |
## Production Checklist
- [ ] IAM policies with least privilege
- [ ] Server-side encryption enabled
- [ ] Dead letter queue configured
- Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.