Skip to content

Using ReceiveMode.PeekLock on the service bus #38

Open
@jcono

Description

@jcono

I will let you know once I have tested but it's my understanding that the combination of ReceiveMode.PeekLock and MessageHandlerOptions.AutoComplete used when registering the message handler will result in SubscriptionClient.CompleteAsync being called once the handler successfully completes.

The source code for the message pump used by the subscription client would suggest this is the case too.

So as far as I can tell the message would be deleted from the queue so long as the registered handler doesn't throw an exception. At least that's how the comments in the code read (the Microsoft documentation is a little light on detail).

What I don't know yet is what happens in the event of an exception in the handler (meaning the message remains on the queue) and whether that message then gets delivered again (to the same receiver) once the peek lock is abandoned. For our usage I'm hoping it does.

Originally posted by @jcono in #37 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions