Closed christian-eriksson closed 5 years ago
@SirSkorpan, I'm trying to reproduce the problem but I'm unable to do so. I've tried to create a queue, send a message and finally receive it on both aws sqs instance and using elasticmq. Here are the "logs":
~/ aws --version
aws-cli/1.16.108 Python/3.7.2 Darwin/18.2.0 botocore/1.12.98
~/ source ~/.aws/keys/me/key.env
~/ aws sqs create-queue --queue-name remoteq --region eu-central-1
{
"QueueUrl": "https://eu-central-1.queue.amazonaws.com/906175111765/remoteq"
}
~/ aws sqs send-message --queue-url https://eu-central-1.queue.amazonaws.com/906175111765/remoteq --message-body "whatever" --region eu-central-1
{
"MD5OfMessageBody": "008c5926ca861023c1d2a36653fd88e2",
"MessageId": "fb8b6277-1d56-4890-a1df-331f89230c7e"
}
~/ aws sqs receive-message --queue-url https://eu-central-1.queue.amazonaws.com/906175111765/remoteq --region eu-central-1 --attribute-names All --message-attribute-names All
{
"Messages": [
{
"MessageId": "fb8b6277-1d56-4890-a1df-331f89230c7e",
"ReceiptHandle": "AQEBH4e+CTmSeg3He6SnZsFU/aY+nMBxpAJZXaU389iX8IRJg9kFGsxehs84SLiqoapwBSIUKlFeagW9bvTUiXNMk6ooTXMsWPR6A97a5wIjWMdC+yUtCmrJTODOi/N7nhXT6VkY5xOWO7mGB/Iwg8Nhuo0H0MxdgJvvOC6aLpUoT+C9VhgHF3uDRFYkuyRTPvXvKDPoX9ygExpRqaEAye5ziy48aDrDXttptbg2sR8TH/o8vvJyNc+OWcCJtuVllPwqIXcC2QEJweYAiYnppLM/aM+VOC5dBWr/OQgee25NPHBfrjKwcRmNmicjUzf50PnpCf68gJLHMIpCQ86HbIiCquxkieuB/W7l83Pp5b76PHZVnC94zWCowRQmQs//+N0bA7p9BTUCUfjJGGaqbF6FQw==",
"MD5OfBody": "008c5926ca861023c1d2a36653fd88e2",
"Body": "whatever",
"Attributes": {
"SenderId": "906175111765",
"ApproximateFirstReceiveTimestamp": "1550651720649",
"ApproximateReceiveCount": "1",
"SentTimestamp": "1550651717923"
}
}
]
}
~/ aws sqs create-queue --endpoint-url http://localhost:9324 --queue-name localq --region eu-central-1
{
"QueueUrl": "http://localhost:9324/queue/localq"
}
~/ aws sqs send-message --endpoint-url http://localhost:9324 --queue-url http://localhost:9324/queue/localq --message-body "whatever" --region eu-central-1
{
"MD5OfMessageBody": "008c5926ca861023c1d2a36653fd88e2",
"MD5OfMessageAttributes": "d41d8cd98f00b204e9800998ecf8427e",
"MessageId": "bab4de73-08f8-464f-816e-7dc6605179a5"
}
~/ aws sqs receive-message --endpoint-url http://localhost:9324 --queue-url http://localhost:9324/queue/localq --region eu-central-1 --attribute-names All --message-attribute-names All
{
"Messages": [
{
"MessageId": "bab4de73-08f8-464f-816e-7dc6605179a5",
"ReceiptHandle": "bab4de73-08f8-464f-816e-7dc6605179a5#82bb65ab-2a28-4975-af50-e5b315e79222",
"MD5OfBody": "008c5926ca861023c1d2a36653fd88e2",
"Body": "whatever",
"Attributes": {
"SentTimestamp": "1550652631309",
"ApproximateReceiveCount": "1",
"ApproximateFirstReceiveTimestamp": "1550652895282",
"SenderId": "127.0.0.1",
"MessageDeduplicationId": "",
"MessageGroupId": ""
}
}
]
}
As you can see elasticmq
returns some additional attributes but both servers don't return anything even related to awsRegion
. Also the format of the message you provided as an example more resembles cloudtrail format than a message returned via invoking receive-message
action on sqs instance. But, what's interesting cloudtrail doesn't support logging events related to message creation.
Could you please clarify how it can be reproduced?
I'm closing this issue since I've received no reply.
When I create a SQS queue like so:
The specified
--region
doesn't seem to reflect the region represented by the messages received from the queue.If I send a message to the either through the JavaScript
aws-sdk
or command line:The message received from the queue would look something like:
But I would have expected the
awsRegion
attribute to sayeu-central-1
instead ofus-west-2
.I'm not sure if this as any practical implications or if it's just cosmetics, because I seem to be able to send messages even if the region specified in the aws-sdk when sending messages is not the one specified for the queue, at creation, nor the one specified for the queue in
serverless.yml
.I've created a small example where the queue is created in
eu-central-1
, but the messages are still reported as being fromus-west-2
.