For long-running message-based requests, we can set the visibility timeout at the queue level, but there doesn't appear to be a way to override it at the message level. I'd like to be able to extend the time for long-running operations without just setting a queue-wide extra long timeout. The underlying SQS service provides the ChangeMessageVisibility function but it's not exposed. From what I can tell, RedisMQ doesn't support the concept at all.
- Is there effectively ever a timeout and retry for RedisMQ?
- Is it possible to expose the ability to extend visibility time from within a service? A long-running operation could then call it periodically to get enough time.
Redis MQ is not related to Amazon SQS or ServiceStack's Amazon SQS MQ other than they're different concrete implementations of ServiceStack's Messaging APIs but a ServiceStack AppHost can only have 1
IMessageServiceregistered so I don't understand how using Redis MQ is relevant to your use of Amazon SQS?Redis MQ is built on top of Redis's List and Pub/Sub primitives and doesn't contain any such MQ customizations.
If you're just referring to Amazon SQS MQ then there's a RegisterHandler overload that lets you specify the
visibilityTimeoutSecondsper message Type so you could have long-running requests executed with a different Request DTO Type which would be my recommendation to keep them isolated. ServiceStack's Auto Mapping makes it easy to convert between Request DTOs with the same schema, e.g:The
SqsMqServerdoes haveRequestFilterandResponseFilteryou can use to inspect theIMessage<T>that's returned by ServiceStack MQ which can be used to change the metadata sent in the SQS Message but not any of its custom message-level properties.To enable fine-grained access to SQS I've added the following filters to
SqsMqServer,SqsMqMessageFactoryandSqsMqClientin this commit which will allow you to intercept and customize the requests going to and coming from Amazon SQS:This change is available from v5.4.1 that's now available on MyGet.