As noted in The AWS Blog by Jeff Barr in 2009, the Amazon Simple Queue Service (SQS) was the first AWS service released.
This queue demo could be demonstrated in (at least) two ways:
awsdemo repoThe former includes examples of AWS CLI commands for sending and receiving messages.
The latter includes examples of using Python code and the boto3 AWS SDK for Python to send and receive messages.
awsdemo repoHere are the purpose points for the queue demo deck.
Steps:
cdk init).
vi lib/queue-stack.ts).
cdk deploy).
cdk destroy).
mkdir queue
cd queue
cdk init app --language=typescript
cdk deploy
aws sqs list-queues
q=$(aws sqs list-queues --query "QueueUrls[0]" --output text)
aws sqs receive-message --queue-url $q --wait-time-seconds 20
aws sqs send-message --queue-url $q --message-body "hello, world"
cdk destroy --force
Queue code examples:
git clone https://github.com/bwer432/awsdemo
cd awsdemo/queue-demo/queue
npm install # repopulate node_modules
npx cdk deploy
aws sqs list-queues
q=$(aws sqs list-queues --query QueueUrls --output text | grep QueueStack-QueueQueue)
aws sqs receive-message --queue-url $q --wait-time-seconds 20
aws sqs send-message --queue-url $q --message-body "hello, world"
python3 ../sqs-send.py $q
python3 ../sqs-recv.py $q
npx cdk destroy --force