Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a fifo queue in SQS using boto3

Can anyone help me with creating a fifo queue in sqs using boto3. Tried this but this doesn’t work

sqs.create_queue(QueueName='test', Attributes={'FifoQueue':'true’})
like image 266
padmakarojha Avatar asked Dec 29 '16 17:12

padmakarojha


2 Answers

This is a complete working example of creating a FIFO queue on SQS:

import boto3
import pprint
import time

sqs = boto3.resource('sqs', region_name='us-west-2')

queue = \
    sqs.create_queue(QueueName='test.fifo', Attributes={'FifoQueue': 'true'})
pprint.pprint(queue)
like image 84
pt12lol Avatar answered Sep 30 '22 13:09

pt12lol


Your queue name has to end in .fifo and you have to be using either us-west-2 or us-east-2 region as those are the only regions that currently support the FIFO feature.

like image 30
garnaat Avatar answered Sep 30 '22 13:09

garnaat