Skip to content

[SERVICE BUS] Consider adding optional drain to batch receive #35846

@m-redding

Description

@m-redding

Library name

Azure.Messaging.ServiceBus

Please describe the feature.

When using the ServiceBusSessionReceiver or ServiceBusReceiver to receive a batch of messages, messages may be out of order when send and receive calls are happening simultaneously. This happens only when you have a sequence like the following: receive call ends because there are no more messages, more messages come in before the next receive call is started. This causes the receiver to release those in between messages since the excess credits are not being drained by default. When released, the service places them behind any additional messages that come in after the start of the call to receive.

To remedy this, consider adding an additional option to drain the excess receive credit. This option would hurt performance when used with concurrency, since credits could have been taken by other calls, so it must be an optional parameter set by the user. This option would presumably be the most useful in the ServiceBusSessionReceiver, where the ordering of batches is important.

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageService Bus

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions