Meet Lee
@leesto
•
PHPSW Organiser
•
Web Team Lead for Gradwell
•
Theatre Tech
•
Theme Park Fan
•
Occasional Photographer
Slide 3
What is SQS
–
Amazon Web Services
“Amazon SQS is a distributed queue system that
enables web service applications to quickly and
reliably queue messages that one component in the
application generates to be consumed by another
component. A queue is a temporary repository for
messages that are awaiting processing.”
Slide 4
Why Queues?
Ideal for tasks we don’t need to complete in real time
Don’t keep the user waiting
Help handle incoming data / content
Help scale large tasks
Slide 5
Why SQS?
Amazon runs the service for you
High availability
Free for the first 1,000,000 requests per month
$0.50 per 1 million after
AWS SDK
Slide 6
Queues
Hold the messages to be processed
Uniquely named per account
Ability to build in a processing delay (up to 15 minutes)
Can be created / configured through the UI or API
Slide 7
Messages
Contains the actual job you want processed
1 blob - up to 256 KB
Found it useful to have this as a JSON object
Option for storing additional attributes
Slide 8
Create a Message
Need to know the URL - separate call to get the URL
from a name
$this
->
awsClient
->
sendMessage
(
array
(
Retrieve a Message
Returns a Response model - check for Messages array
Can implement long polling
Queues define a ‘message visibility’ period
$this
->
awsClient
->
receiveMessage
(
array
(