I try to use LocalStack and create aws sqs queues locally. Here is my terminal:
I create queues using this command aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name activitiesQueue
Then list queue using this command aws --endpoint-url=http://localhost:4566 sqs list-queues
Then created queues are displayed.
I try to consume queue messages using command or try to start node.js server:
Command:aws --endpoint-url=http://localhost:4566 sqs send-message --region us-east-1 --queue-url "http://localhost:4566/000000000000/activitiesQueue" --message-body '{"command":["do-something"]}'
then the following error occurred.
An error occurred (AWS.SimpleQueueService.NonExistentQueue) when calling the SendMessage operation: The specified queue does not exist for this wsdl version
I also set aws credentials:
path: C:\Users\user.aws
[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I checked the LocalStack default region using LocalStack config show
command.
The default region was "ap-southeast-1". Then I created a queue with the aws region in the config.js file.
Region mismatch was the cause of the error.
aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name activitiesQueue --region us-east-1
Then using aws --endpoint-url=http://localhost:4566 sqs list-queues --region us-east-1
command I checked all the created queues in the LocalStack.