Nextdoor/ndkale

DelaySeconds parameter not compatible with FIFO Queue.

Closed this issue · 1 comments

This error can also be found at ndkale/example/kale/publisher.py: line 60,

Fix could be initializing first the standard parameters into a dict object

params = {
    "MessageBody":kale_msg.encode()
}

then appropriating the different requirements for each queue types into it

if someFunctionToGetQueueType == 'FIFO':
    params[MessageGroupId] =  group_id or 'default',
elif someFunctionToGetQueueType ==== 'Standard':
    params[DelaySeconds] = delay_sec or 1

which then could be passed to the send_message() function as

sqs_queue.send_message(**params)

Proposed fix for this is included in the thread here: #49