tidwall / tile38

Real-time Geospatial and Geofencing
https://tile38.com
MIT License
9.15k stars 570 forks source link

Support SQS Fifo queues for Hooks #591

Open tobilg opened 3 years ago

tobilg commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, SQS Fifo queues don't seem to be supported. I see the following error in the logs:

2020/12/06 11:46:37 [DEBU] Endpoint connect/send error: 1: https://sqs.us-east-1.amazonaws.com/123456789/myqueue.fifo: MissingParameter: The request must contain the parameter MessageGroupId.
        status code: 400, request id: 092ce8e1-ff47-593e-aa58-b0a7399a0e9b

Describe the solution you'd like Tile38 could detect SQS Fifo queues based on the .fifo suffix, and then add an additional parameter for MessageGroupId to the sendMessage request. The MessageGroupId could the static, i.e. tile38.

See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html

tidwall commented 3 years ago

Is the .fifo suffix standard with SQS? If not I think it might be best to use a query string variable like:

https://sqs.us-east-1.amazonaws.com/123456789/myqueue?fifoqueue=1&messageGroupID=tile38

This would be more consistent with how Tile38 uses endpoint urls.

tobilg commented 3 years ago

Thanks for the fast reply! Yes, the suffix needs to be .fifo to define a SQS Fifo queue, according to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-name

Being able to optionally define the MessageGroupId via query string would be nice.