Skip to content

Commit

Permalink
Skip reconnecting batching receiver when connection fails (Azure#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a authored Dec 18, 2018
1 parent 8af12d2 commit 9080e1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/core/messageReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,18 @@ export class MessageReceiver extends LinkEntity {
// Clears the token renewal timer. Closes the link and its session if they are open.
// Removes the link and its session if they are present in rhea's cache.
await this._closeLink(this._receiver);

if (this.receiverType === ReceiverType.batching) {
log.error(
"[%s] Receiver '%s' with address '%s' is a Batching Receiver, so we will not be " +
"re-establishing the receiver link.",
connectionId,
this.name,
this.address
);
return;
}

// We should attempt to reopen only when the receiver(sdk) did not initiate the close
let shouldReopen = false;
if (receiverError && !wasCloseInitiated) {
Expand Down

0 comments on commit 9080e1a

Please sign in to comment.