Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Source: Amazon SQS

The SQS source receives messages from Amazon SQS queues and delivers them into a pg_tide inbox. It uses long polling for efficient message retrieval and deletes messages from SQS only after successful inbox insertion.

Configuration

SELECT tide.relay_set_inbox(
    'events-from-sqs',
    'incoming_events',
    '{
        "source_type": "sqs",
        "queue_url": "${env:SQS_QUEUE_URL}",
        "region": "us-east-1",
        "wait_time_seconds": 20,
        "visibility_timeout": 60,
        "batch_size": 10
    }'::jsonb
);

Configuration Reference

ParameterTypeDefaultDescription
source_typestringMust be "sqs"
queue_urlstringSQS queue URL
regionstringAWS region
wait_time_secondsint20Long poll wait time (max 20)
visibility_timeoutint60Seconds before unprocessed messages become visible again
batch_sizeint10Messages per ReceiveMessage call (max 10)
access_key_idstringnullAWS credentials (optional, falls back to default chain)
secret_access_keystringnullAWS secret key

Delivery Guarantees

Messages are deleted from SQS only after inbox insertion succeeds. The inbox's deduplication uses the SQS message ID, preventing duplicates from Standard queues (which may deliver messages more than once). FIFO queues provide exactly-once semantics.

Further Reading