Particular / NServiceBus.AmazonSQS

An AWS SQS transport for NServiceBus.
Other
36 stars 20 forks source link

Evaluate if is it worth exposing the message visibility timeout setting #1002

Open mauroservienti opened 3 years ago

mauroservienti commented 3 years ago

As part of #998 it was necessary to expose to users the message visibility timeout as a configurable setting. We made the decision to expose that as a setting bound to the message-driven pub/sub compatibility mode in the SqsSubscriptionMigrationModeSettings class: https://github.com/Particular/NServiceBus.AmazonSQS/blob/8be2241b6e60579b40e657531b22dfab566395a0/src/NServiceBus.Transport.SQS/Configure/SqsSubscriptionMigrationModeSettings.cs#L52-L63

Due to the way SQS works (message pickup + visibility timeout) there always is the possibility that, if message processing takes longer than the default (30") visibility timeout, it results in a duplicate message.

One option could be to expose the message visibility timeout as a transport setting and not only a message-driven pub/sub compatibility mode setting.

jdaigle commented 1 year ago

I think this is worth it: https://github.com/Particular/NServiceBus.AmazonSQS/issues/2162

mauroservienti commented 1 year ago

Thanks for your input, @jdaigle. We discussed this in the past, and we were debating if it's better to have this one or https://github.com/Particular/NServiceBus.AmazonSQS/issues/1003, which automatically extends the visibility timeout for message handling running longer than the default. Both have pros and cons. What is the scenario that makes you want to have control over the visibility timeout?

jdaigle commented 1 year ago

@mauroservienti The simplest scenario is where the default timeout of the queue isn’t sufficient (e.g. too low) and for whatever reason can’t be changed.

I can also imagine using this setting when creating the queue, and maybe updating the attributes for an existing queue.