servicebus - Messages are not getting deleted from azure service bus subscription -


am using azure service bus messaging, in i'm getting strange issue.

i created subscription client "peeklock" mode. using subscriptionclient.receivebatch(500) method , received 'n' messages. loop messages , process, if process completed use brokeredmessage.complete() remove message queue. if there issue in process using brokeredmessage.abandon() renew message. messages not removed queue.

after analysis, suspect process taking more time , message locks getting expired before the process complete.

then decided, after received message queue, pushed messages local string array , called brokeredmessage.complete(). there no possibility lock expiration. still messages not removed queue.

kindly give idea fix issue.

*

brokeredmessage.abandon() renew message. messages not removed queue.

*

abandon not abandon message. abandon's lock.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.brokeredmessage.abandon?view=azureservicebus-4.0.0#microsoft_servicebus_messaging_brokeredmessage_abandon

abandons lock on peek-locked message.

abandon allow message become reavailable @ later time.

call .complete message off queue.

and gotta careful, suggest...about getting n (500 in case) messages...and not being able complete (all of) them before lock mechanisms take effect.

here ideas.

http://markheath.net/post/defer-processing-azure-service-bus-message

this best idea i've seen, however, single message.

http://dotnetartisan.in/2016/01/24/avoiding-messagelocklostexception-using-auto-renew-pattern-for-brokeredmessage-service-bus-queue/


Comments