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 message_id vs MessageId #997

Closed
iamtennislover opened this issue Feb 22, 2017 · 3 comments
Closed

SQS message_id vs MessageId #997

iamtennislover opened this issue Feb 22, 2017 · 3 comments
Labels
guidance Question that needs advice or information.

Comments

@iamtennislover
Copy link

I see that message.message_id is different from body['MessageId']? What is the difference between the two?

sqs = boto3.resource('sqs', region_name=region, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
queue_obj = sqs.Queue(queue_url)
messages = queue_obj.receive_messages(
            AttributeNames=['All'],
            MessageAttributeNames=['All'],
            VisibilityTimeout=15,
            WaitTimeSeconds=20,
            MaxNumberOfMessages=5
)
for message in messages:
    body = json.loads(message.body)
    print(str(message.message_id) == str(body['MessageId'])) # This prints False all the time
@iamtennislover
Copy link
Author

@kyleknap
Copy link
Member

I replied back on the Stack Overflow post. Let's keep the conversation there as we are trying to limit open GitHub issues to bugs and feature requests as shown in the boto3 README.

@kyleknap kyleknap added guidance Question that needs advice or information. move-to-stackoverflow labels Feb 23, 2017
@iamtennislover
Copy link
Author

Thanks. I would like know which Id is going to be unique in a queue? I would like to store messages by id as key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants