vsouza/docker-SQS-local

SQS send_messages method response different from AWS resource

babaMar opened this issue · 4 comments

The following code:

import boto3


sqs_resource = boto3.resource('sqs', region_name='us-west-1')
sqs_queue = sqs_resource.get_queue_by_name(QueueName='test-queue')

res = sqs_queue.send_messages(Entries=[
    {'Id': '1', 'MessageBody': json.dumps({'body': 'the body'})},
    {'Id': '2', 'MessageBody': json.dumps({'body': 'the body'})},
    {'Id': '3', 'MessageBody': json.dumps({'body': 'the body'})}
])

gives a different response from the one given when using a real AWS resource:

{'ResponseMetadata': {'RequestId': '00000000-0000-0000-0000-000000000000', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'akka-http/10.1.3', 'date': 'Wed, 17 Apr 2019 09:48:34 GMT', 'content-type': 'text/plain; charset=UTF-8', 'content-length': '356'}, 'RetryAttempts': 0}}

real-resource response:

{'ResponseMetadata': {'HTTPHeaders': {'content-length': '861',
                                      'content-type': 'text/xml',
                                      'date': 'Thu, 18 Apr 2019 10:10:42 GMT',
                                      'x-amzn-requestid': '17e336a0-0649-5dc1-8c0f-6392492b6b4a'},
                      'HTTPStatusCode': 200,
                      'RequestId': '17e336a0-0649-5dc1-8c0f-6392492b6b4a',
                      'RetryAttempts': 0},
 'Successful': [{'Id': '1',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '510f82e2-6bc5-4ca5-acda-e74f7166782a'},
                {'Id': '2',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '3fd7c53e-ced4-48e1-8ed5-4402e0b7865b'},
                {'Id': '3',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '8be0c543-e77f-42d0-a297-62b289481ea2'}]}

@babaMar Can you report this issue to the ElasticMQ project? They can help you better.

@vsouza it works if I use directly ElasticMQ container, maybe need to pull the latest version in your Dockerfile?

@babaMar Can you test and get back here with an update to us?

it works correctly.