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¶
- Connect to AWS
- Build the topology
- Resolve topics and queues your own way
- Choose a wire format
- Use all of FIFO's twelve hours
- Watch for unreadable messages
- Run the conformance suite against LocalStack
Understand it¶
- Standard or FIFO
- Why it binds and never creates
- How a message is settled
- What happens to a message nothing can read