Skip to main content
Winter SQS is an AWS SQS module for Winter Boot that provides both producer (send) and consumer (receive / process) capabilities. If you already use the Kafka or S3 modules, the configuration patterns here, like named connections and workers, will feel familiar.

Setup

Require the modules package with Composer (it pulls in aws/aws-sdk-php):
Enable the module in your application.yml:
configFile is a file path relative to your config directory or an absolute path.

sqs-config.yml

Named connections define how to reach AWS SQS (region, credentials, and so on). At runtime you refer to a connection by name and pass the queue name separately.

Autowired services

SqsService

SqsService is the primary service for sending messages and managing queues. Inject it with #[Autowired]:

SqsConnections

SqsConnections holds all registered connections indexed by name. Use it when you need direct access to a specific connection:

SqsConnection (individual bean)

Each named connection is also registered as an individual bean with the suffix _connection. You can autowire a specific connection by name:

Connection properties

Using IAM roles (no keys required)

When your application runs on AWS infrastructure (EKS, EC2, Lambda, ECS, and so on), you do not need to specify credentials. The AWS SDK automatically picks up the IAM role through the default credential chain.

EKS IRSA example

  1. Create an IAM role with the required SQS permissions.
  2. Annotate your Kubernetes ServiceAccount with the role ARN: eks.amazonaws.com/role-arn: arn:aws:iam::123456789:role/my-sqs-role
  3. Omit the credentials block. The SDK uses the IRSA-provided credentials automatically.

Consumer properties

How to write a consumer worker

Implement the Consumer interface (or extend AbstractConsumer):
For self-hosted event streaming, see the Kafka module.