Create a message and print its messageId - AWS SQS

0 votes
How do I create a message and print its messageID on AWS SQS using boto? Also, can I create a message with custom attributes?
Aug 20, 2019 in AWS by Shakira
1,800 views

1 answer to this question.

0 votes

Use the following code for adding a message at the end of the queue:

sqs = boto3.resource('sqs')

queue = sqs.get_queue_by_name(QueueName='test')

response = queue.send_message(MessageBody='world')
print(response.get('MessageId'))
print(response.get('MD5OfMessageBody'))

And have a look at this thread to create a message using the custom attributes: https://www.edureka.co/community/55186/can-i-create-a-message-with-custom-attributes-aws-sqs

answered Aug 20, 2019 by Vishal

Related Questions In AWS

0 votes
1 answer

Access identifiers and attributes of a specific queue - AWS SQS

You can access the identifiers and attributes ...READ MORE

answered Aug 20, 2019 in AWS by Ganga
570 views
0 votes
1 answer

Lookup a queue by its name - AWS SQS

Yes, it is possible to lookup for ...READ MORE

answered Aug 20, 2019 in AWS by Akaash
2,281 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Can I create a message with custom attributes? - AWS SQS

Yess! You can create a message with ...READ MORE

answered Aug 20, 2019 in AWS by Keshav
1,679 views
0 votes
1 answer

Create a queue using boto - AWS SQS

Try this code: # Get the service resource sqs ...READ MORE

answered Aug 20, 2019 in AWS by Vishal
757 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP