Right now we complete sagas which were successful from business point of view, but we store failed sagas for 3 months - we set a timeout and then mark saga as completed.
Is there a more generic way for setting saga's Time-To-Live which does not involve underlying messaging service?
For example AWS SQS max delay is 15 minutes, but for us it would be enough to run the garbage collection job once a week. Does NSB have this option?
Is there a more generic way for setting saga's Time-To-Live which does not involve underlying messaging service?
NServiceBus implements timeouts using delayed messages. SQS happened to be limited to a maximum of 15 minutes. To overcome this limitation, transport rescheduled the message multiple times to get the desired delay. Other transports such as Azure Service Bus, RabbitMQ, SQL Server transport do not require this as they can send a single delayed message for the necessary time. RabbitMQ doesn't support it natively either, so it also implements the feature internally. There's no "general" implementation. It's always specific to the transport you're using.
That's exactly what NServiceBus is doing by using the delayed delivery. Unfortunately, SQS as you've noticed doesn't support periods longer than 15 mins.
You could use a 3rd party scheduling library that would send a message that would complete the saga. https://docs.particular.net/nservicebus/scheduling/
I'll also follow-up internally to see if there are other recommendations.