Skip to main content

Config

Use queue_names when one streaming source block should consume from multiple SQS queues. Mage polls every configured queue and sends received messages through the same downstream streaming pipeline. Existing single-queue configs can continue to use queue_name:
By default, startup fails if any configured queue can’t be initialized, including when a queue is missing, configured for the wrong AWS region, or denied by IAM. This avoids silently ignoring events from one producer. If you want best-effort consumption from the queues that can be initialized, opt in with:
When skip_failed_queues is enabled, Mage logs the failed queue name and continues polling the remaining queues. If every configured queue fails to initialize, startup still fails.

Authentication

Here are the options to authenticate with AWS SQS.
  1. Grant your Mage runtime an AWS IAM role with access to the configured queues. This is the recommended option for Mage deployments running on AWS infrastructure.
  2. Add the following keys and values to your runtime environment variables:
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • AWS_SESSION_TOKEN if you’re using temporary AWS credentials
    • AWS_DEFAULT_REGION
  3. Configure credentials in the source config. Use environment-variable references instead of pasting raw secrets into the block YAML:
  4. If you deploy Mage on an AWS ECS cluster, you can use the ECS task execution role to authenticate. Grant the ECS task permissions to access SQS by attaching IAM policies to this role.
If you get the botocore.exceptions.NoRegionError error, try setting the AWS_DEFAULT_REGION environment variable.

Pass raw message to transformer

Message deletion method

We support two ways to delete messages:
  1. Delete the message in the data loader automatically after deserializing the message body.
    • Set message_deletion_method: AFTER_RECEIVED in the source config.
    • The input of the transformer is the list of deserialized message body.
  2. Manually delete the message in transformer after processing the message.
    • Set message_deletion_method: MANUAL in the source config.
    • The input of the transformer is the list of dictionary with the structure
      You can use the following example code to process the message and delete it after.