Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mauroservienti opened this issue Sep 16, 2021 · 3 comments

Comments

@mauroservienti
Copy link
Member

mauroservienti commented Sep 16, 2021

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:

public SubscriptionMigrationModeSettings MessageVisibilityTimeout(int timeoutInSeconds)
{
//HINT: See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
if (timeoutInSeconds < 0 || timeoutInSeconds > TimeSpan.FromHours(12).TotalSeconds)
{
throw new ArgumentOutOfRangeException(nameof(timeoutInSeconds));
}
settings.Set(SettingsKeys.MessageVisibilityTimeout, timeoutInSeconds);
return this;
}

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
Copy link

jdaigle commented May 10, 2023

I think this is worth it: #2162

@mauroservienti
Copy link
Member Author

Thanks for your input, @jdaigle. We discussed this in the past, and we were debating if it's better to have this one or #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
Copy link

jdaigle commented May 10, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants