You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Service Bus] Session Receiver (Both batching and streaming) during a disconnect (Azure#13956)
### Issue Azure#8875
### What's in the PR
"disconnect"/refresh logic added before did not cover the session scenarios.
This PR attempts to tackle the batching receiver for sessions upon "disconnect" scenarios to have a smooth-resolution/throw-errors based on the receiveMode.
Streaming receiver calls processError with SessionLockLost and closes the link
### receiveMessages - Scenarios to handle/test
- [x] throws "session lock has expired" after a disconnect
- [x] returns messages if drain is in progress (receiveAndDelete)
- [x] throws an error if drain is in progress (peekLock)
- [x] returns messages if receive in progress (receiveAndDelete)
- [x] throws an error if receive is in progress (peekLock)
### Streaming receiver
- [x] Test - calls processError and closes the link
### TODO
- [x] Cover the scenarios above
- [x] Tests
- [x] Bug fix - number of receivers - Azure#13990
- [x] Changelog
- [x] Streaming receiver - ~~beyond the scope of this PR~~ Azure#14212
- [ ] Bad log messages Azure#13989 - beyond the scope of this PR
- [ ] Stress testing plan for disconnect - Azure#13988 - beyond the scope of this PR
FixesAzure#8875
- When receiving messages from sessions using either the `ServiceBusSessionReceiver.receiveMessages` method or the `ServiceBusSessionReceiver.subscribe` method, errors on the AMQP link or session were being handled well, but an error on the AMQP connection like a network disconnect was not being handled at all. This results in the promise returned by the `receiveMessages` method never getting fulfilled and the `subscribe` method not calling the user provided error handler.
9
+
This is now fixed in [#13956](https://github.com/Azure/azure-sdk-for-js/pull/13956) to throw `SessionLockLostError`. If using the `receiveMessages` method in `receiveAndDelete` mode, then the messages collected so far are returned to avoid data loss.
10
+
8
11
- Allow null as a value for the properties in `ServiceBusMessage.applicationProperties`.
0 commit comments