Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQS send_messages method response different from AWS resource #27

Open
babaMar opened this issue Apr 18, 2019 · 5 comments
Open

SQS send_messages method response different from AWS resource #27

babaMar opened this issue Apr 18, 2019 · 5 comments

Comments

@babaMar
Copy link

babaMar commented Apr 18, 2019

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'}]}
@roribio
Copy link
Owner

roribio commented Apr 25, 2019

Hi @babaMar,

Thanks for your interest in this project and submitting an issue.

This project is nothing more than a packaging of Softwaremill's elasticmq server. Unless I'm misunderstanding your issue, I believe this is something that can be better addressed by @adamw.

Cheers,
Ronald

@babaMar
Copy link
Author

babaMar commented Apr 25, 2019

Hi @roribio,

yeah I realized that, when I run ElasticMQ locally it actually returns the correct response tho, that's why I opened this issue.

@roribio roribio reopened this May 5, 2019
@roribio roribio removed the wontfix label May 5, 2019
@roribio
Copy link
Owner

roribio commented May 5, 2019

I see 🤔 Could you provide more info to help debug this issue? For example, which version of ElasticMQ are you running locally? Which version of alpine-sqs are you running?

Any details that you can provide will help.

Thanks!

@babaMar
Copy link
Author

babaMar commented May 6, 2019

For both containers I use to pull images, so versions that come with softwaremill/elasticmq and roribio16/alpine-sqs

@michaelcohenunsw
Copy link

This is caused by SQS insights in the container receiving the messages and causing the visibility timeout to begin. Your code is trying to receive messages from the queue which are inflight. I worked around this issue by turning off SQS insights (the web UI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants