[FEATURE REQ] Manual message lock renewal when using ServiceBusProcessor
See original GitHub issueLibrary or service name. Azure.Messaging.ServiceBus
Is your feature request related to a problem? Please describe.
I would like a way to manually renew the lock of a ServiceBusReceivedMessage
when receiving messages through the ProcessMessageAsync
message handler of a ServiceBusProcessor
.
Using a ServiceBusReceiver
to receive messages gives access to ServiceBusReceiver.RenewMessageLockAsync(ServiceBusReceivedMessage message, CancellationToken cancellationToken)
, but that call is unavailable through the ProcessMessageEventArgs
argument of a ServiceBusProcess.ProcessMessageAsync
message handler delegate.
I know there is the ServiceBusProcessorOptions.MaxAutoLockRenewalDuration
option to use, but in my case a call may take anyway from less than a second, up to several hours. I want to be able to handle renewals manually, in order to make sure we are not stuck somewhere unexpected.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
Luckily, I don’t use sessions, but thanks for letting me know.
Yeah it works in this particular case because renewing a message lock doesn’t interfere with receiving messages. Interestingly, it would not work if you were using sessions as you need a session lock to renew the session, which means you couldn’t have both a processor and a receiver for the same session.