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 in AWS by Shakira
21 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 by Vishal

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

Lookup a queue by its name - AWS SQS

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

answered Aug 20 in AWS by Akaash
34 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Create a queue using boto - AWS SQS

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

answered Aug 20 in AWS by Vishal
17 views