sqs
БесплатноБез исполняемых скриптовНе проверенAmazon SQS managed message queue service. Covers standard and FIFO queues, dead-letter queues, and integration patterns. Use for AWS-native serverless and…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Amazon SQS Core Knowledge
Full Reference: See advanced.md for Java/Python/Go producers, Spring Cloud AWS consumers, Lambda integration, IAM policies, and CloudWatch monitoring.
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:sqsfor comprehensive documentation.
Quick Start (LocalStack)
# 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:
# 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)
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)
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
// 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
},
}));
# 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
// Lambda handler
export const handler = async (event: SQSEvent): Promise<SQSBatchResponse> => {
Установить sqs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditВложенные файлы
FAQ
Что делает скилл 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`
Как установить скилл sqs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sqs запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic