本文へ移動
cccskills
無料GitHub で公開

aws-sqs

Work with Amazon SQS for reliable message queuing. Create standard and FIFO queues, configure dead-letter queues for failed messages, send and receive messages in batches, and build decoupled event-driven architectures.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md6.2 KB
  • _scores.json1.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

AWS SQS

Amazon Simple Queue Service (SQS) is a fully managed message queuing service for decoupling microservices. It offers two queue types: Standard (best-effort ordering, at-least-once delivery) and FIFO (exactly-once, ordered).

Core Concepts

  • Standard Queue — unlimited throughput, at-least-once delivery, best-effort ordering
  • FIFO Queue — exactly-once processing, strict ordering, 3000 msg/s with batching
  • Visibility Timeout — period a message is hidden after being received
  • Dead-Letter Queue (DLQ) — destination for messages that fail processing
  • Message Group ID — FIFO ordering key for parallel processing within a queue
  • Long Polling — reduces empty responses and API costs

Creating Queues

# Create a standard queue
aws sqs create-queue \
  --queue-name order-processing \
  --attributes '{
    "VisibilityTimeout": "60",
    "MessageRetentionPeriod": "1209600",
    "ReceiveMessageWaitTimeSeconds": "20"
  }'
# Create a FIFO queue (name must end in .fifo)
aws sqs create-queue \
  --queue-name order-processing.fifo \
  --attributes '{
    "FifoQueue": "true",
    "ContentBasedDeduplication": "true",
    "VisibilityTimeout": "60"
  }'

Dead-Letter Queues

# Create the DLQ first
aws sqs create-queue --queue-name order-processing-dlq

# Get DLQ ARN
DLQ_ARN=$(aws sqs get-queue-attributes \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing-dlq \
  --attribute-names QueueArn --query 'Attributes.QueueArn' --output text)

# Configure main queue to use DLQ after 3 failed attempts
aws sqs set-queue-attributes \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --attributes '{
    "RedrivePolicy": "{\"deadLetterTargetArn\":\"'$DLQ_ARN'\",\"maxReceiveCount\":\"3\"}"
  }'
# Redrive messages from DLQ back to source queue
aws sqs start-message-move-task \
  --source-arn "$DLQ_ARN" \
  --destination-arn "arn:aws:sqs:us-east-1:123456789:order-processing"

Sending Messages

# Send a single message
aws sqs send-message \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --message-body '{"orderId":"12345","action":"process"}' \
  --message-attributes '{
    "OrderType": {"DataType":"String","StringValue":"premium"}
  }'
# Send to FIFO queue with group ID
aws sqs send-message \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing.fifo \
  --message-body '{"orderId":"12345","action":"process"}' \
  --message-group-id "customer-789" \
  --message-deduplication-id "order-12345-v1"

Batch Operations

# Send up to 10 messages in a batch
aws sqs send-message-batch \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --entries '[
    {"Id":"1","MessageBody":"{\"orderId\":\"001\"}"},
    {"Id":"2","MessageBody":"{\"orderId\":\"002\"}"},
    {"Id":"3","MessageBody":"{\"orderId\":\"003\"}"}
  ]'
# Batch consumer with boto3
import boto3
import json

sqs = boto3.client('sqs')
QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/123456789/order-processing'

def poll_and_process():
    while True:
        response = sqs.receive_message(
            QueueUrl=QUEUE_URL,
            MaxNumberOfMessages=10,  # batch up to 10
            WaitTimeSeconds=20,       # long polling
            MessageAttributeNames=['All']
        )
        messages = response.get('Messages', [])
        if not messages:
            continue

        entries_to_delete = []
        for msg in messages:
            try:
                body = json.loads(msg['Body'])
                process_order(body)
                entries_to_delete.append({
                    'Id': msg['MessageId'],
                    'ReceiptHandle': msg['ReceiptHandle']
                })
            except Exception as e:
                print(f"Failed: {e}")
                # Message returns to queue after visibility timeout

        if entries_to_delete:
            sqs.delete_message_batch(
                QueueUrl=QUEUE_URL,
                Entries=entries_to_delete
            )

Receiving and Deleting

# Receive messages with long polling
aws sqs receive-message \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --max-number-of-messages 5 \
  --wait-time-seconds 20 \
  --message-attribute-names All
# Delete a processed message
aws sqs delete-message \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --receipt-handle "AQEBzL..."
# Change visibility timeout for a message needing more processing time
aws sqs change-message-visibility \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --receipt-handle "AQEBzL..." \
  --visibility-timeout 120

Monitoring

# Check queue depth
aws sqs get-queue-attributes \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing \
  --attribute-names ApproximateNumberOfMessages,ApproximateNumberOfMessagesNotVisible,ApproximateNumberOfMessagesDelayed
# Purge all messages (use with caution)
aws sqs purge-queue \
  --queue-url https://sqs.us-east-1.amazonaws.com/123456789/order-processing

Best Practices

  • Always enable long polling (WaitTimeSeconds=20) to reduce costs
  • Set up dead-letter queues on every queue to catch poison messages
  • Use FIFO queues only when ordering matters — standard queues have much higher throughput
  • Process and delete messages in batches for efficiency
  • Set visibility timeout to 6x your average processing time
  • Use message group IDs in FIFO queues for parallel ordered processing
  • Monitor ApproximateNumberOfMessages and alert on queue depth spikes
  • Implement idempotent consumers — messages may be delivered more than once

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Scripts and configures production rendering in Autodesk 3ds Max with the V-Ray and Corona renderers: output size and files, render elements, denoising, light mix, batch and command-line rendering, and network rendering. Use when a user asks to set up a production render, render several cameras in one batch, render from the command line or on a render farm, add render passes for compositing, or cut render time for archviz and product shots.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Covers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material assignment, camera and light setup, batch operations, and file I/O. Use when tasks involve automating repetitive 3ds Max workflows, batch processing scenes, running scripts headless with 3dsmaxbatch, creating custom tools, or scripting scene setup for archviz, product visualization, or VFX.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

3proxy

無料

3proxy is a small open-source proxy server that runs HTTP/HTTPS, SOCKS4/5, SNI and TCP/UDP port-mapping proxies from one config file. Use when a user asks to set up an HTTP or SOCKS5 proxy, add proxy users and passwords, write 3proxy access rules, chain or rotate upstream (parent) proxies, limit bandwidth, connections or monthly traffic per user, run 3proxy in Docker, or fix a 3proxy.cfg that will not start.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Builds Agent2Agent (A2A) servers and clients, the open protocol (originally from Google, now under the Linux Foundation) that lets AI agents from different frameworks call each other. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a protocol, a2a server, a2a client, agent card, agent interoperability, agent collaboration, multi-agent, agent discovery, a2a sdk, a2a task.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Plans a controlled experiment (A/B test) so its result can be trusted: writes the hypothesis, picks one primary metric and the guardrails, computes sample size and run time, specifies how visitors are assigned and when exposure is logged, and reads out the result with a confidence interval. Use when someone says "set up an A/B test", "split test this page", "how many visitors do I need", "how long should the experiment run", "is this result significant", "can I stop the test early", or wants to test a headline, price, layout or onboarding change against the current version.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

ably

無料

Ably is a hosted realtime messaging service: clients publish and subscribe to named channels over WebSockets, see who is present, replay message history, and resume after a dropped connection. Use when a user asks to "add realtime updates", "push live notifications to the browser", "show who is online", "add a chat room with typing indicators", "publish from a serverless function", or "authenticate Ably clients without exposing the API key". Covers the ably 2.x JavaScript SDK (Realtime and REST), JWT token authentication, presence, history and rewind, batch publishing, and the @ably/chat 1.x SDK.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

TerminalSkills のスキルをすべて見る

このスキルの問題を報告する