Skip to content

Amazon SQS Bindings

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. AsyncAPI provides bindings for SQS to define how your event-driven APIs interact with SQS queues.

What is Amazon SQS?

SQS offers two types of message queues:

  • Standard Queues: Offer maximum throughput, best-effort ordering, and at-least-once delivery.
  • FIFO (First-In-First-Out) Queues: Designed to guarantee that messages are processed exactly once, in the exact order that they are sent.

AsyncAPI SQS Bindings Overview

AsyncAPI SQS bindings map your API specification to SQS concepts:

Binding Types

Binding TypePurposeDescription
Channel BindingDefine SQS queue propertiesSpecifies queue type (standard or FIFO), visibility timeouts, and other queue-level settings.
Operation BindingConfigure message producers and consumersDefines how to interact with a specific queue, including policies.
Message BindingMessage-level configurationsDefines message attributes like delay and deduplication identifiers.
Server BindingServer-level configurationsReserved for future server-specific SQS configurations.

Supported Versions

VersionStatusKey Features
0.3.0LatestFull feature set, including tag support.
0.2.0StableAdds support for message-level identifiers.
0.1.0LegacyBasic support for queue configuration.

Key SQS Concepts

Queues

The fundamental resource in SQS. A queue stores messages until they are processed and deleted.

Message Attributes

SQS lets you include structured metadata (such as timestamps, geospatial data, signatures, and identifiers) with messages. Message attributes are optional and separate from, but sent along with, the message body.

Dead-Letter Queues (DLQs)

A queue that other (source) queues can target for messages that can't be processed (consumed) successfully. DLQs are useful for debugging your application or messaging system because they let you isolate unconsumed messages to determine why their processing failed.

Getting Started

Basic Channel Configuration (FIFO)

yaml
channels:
  userSignup:
    bindings:
      sqs:
        queue:
          name: user-signup.fifo
          fifo: true
          visibilityTimeout: 60
        bindingVersion: '0.2.0'

Basic Operation Configuration

yaml
operations:
  sendWelcomeEmail:
    bindings:
      sqs:
        queue:
          policy:
            statements:
              - effect: Allow
                principal: 'arn:aws:iam::123456789012:user/some-user'
                action: 'sqs:SendMessage'
        bindingVersion: '0.2.0'

Binding Documentation

Channel Bindings

Operation Bindings

Message Bindings

Server Bindings