I am trying to run a process which sends a series of messages to an SQS FIFO queue for a set of devices we have on hand every n seconds:
while 1:
for i in range(0, len(device_list)):
print("Putting message on queue for {}".format(device_list[i]))
resp = sqs.send_message(
QueueUrl=url,
MessageAttributes={
'device': {'DataType': 'String', 'StringValue': device_list[i]},
'start': {'DataType': 'Number', 'StringValue': stime},
'end': {'DataType': 'Number', 'StringValue': etime}
},
MessageBody=(
'SQS message test'
),
MessageGroupId=id
)
sleep(n)
Currently testing with just 20 devices. The problem I'm having is that only the first message I send is being received by the FIFO queue (checked the SQS console directly, the MessagesAvailable attribute says 1). I don't have the same problem with a Standard queue (MessagesAvailable attribute says 20), but ordering is important, so a FIFO queue is the way to go for my purposes.
I'm new to SQS, so I'm unsure if there's a problem with my queue configuration (using default settings), if it's just a feature of SQS FIFO queues, or whether I'm using the boto library correctly. Is there something I'm missing or doing incorrectly?