Skip to content

The SQS adapter

Run go/messaging over Amazon SQS and SNS: an SNS topic in front of each subject, an SQS queue behind each subscription.

gitlab.com/phpboyscout/go/messaging-sqs is the SQS adapter for go/messaging. It implements the backend contract twice:

backend := sqs.Standard(settings) // throughput; at-least-once only
backend := sqs.FIFO(settings)     // ordered; at-most-once and at-least-once

Both return a messaging.Backend. Hand either to messaging.New.

It binds to AWS resources and does not create them. The topics, queues, subscriptions and redrive policies are yours; the adapter resolves them by name and fails naming whichever is missing. The one exception is an at-most-once fan-out subscription, which gets a queue of its own for the life of its source.

It is pre-1.0 and tracks the core. This section describes its main branch, and its changelog says which release carries each change. The design is go/messaging's spec 0007, and where this section and a spec differ, this section describes the code.

The conformance suite runs against LocalStack 4.14.0, not against AWS. See Tested versions.

Start here

Publish and receive through SQS builds the topology on LocalStack, then publishes an event and has a subscription receive it.

Do a task

Understand it

Look something up