Skip to content

[FEATURE REQ] Consider exposing a way to close a session from the ServiceBusSessionProcessor #23498

@JoshLove-msft

Description

@JoshLove-msft

In Azure/azure-sdk-for-net#18527, users pointed out that having the ability to end processing for a session early (i.e. not waiting for the receive call to timeout which is the switching mechanism used in the .NET SDK) is important for various scenarios:

  • sparse sessions - if a session only ever contains a single message, it should be closed immediately after processing to save time
  • handler knows that it cannot process a particular session anymore for some application-specific reason

This was supported in Microsoft.Azure.ServiceBus since the MessageSession inherited from the receiver types and could be closed directly. The approach used in Azure.Messaging.ServiceBus is a bit more nuanced since there could be multiple threads processing a single session at once. Also, we would want to make sure AutoComplete still works rather than just closing the link immediately. Thus, the ReleaseSession method that was added in Azure/azure-sdk-for-net#22525 does not immediately close the session, but signals to the processor that no new messages should be received from the session - once all processing is done for the session the link is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Service Busfeature-requestThis issue requires a new behavior in the product in order be resolved.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions