Skip to content

Commit

Permalink
Workaround for Azure#5757 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramya Raja committed Nov 1, 2019
1 parent 712838f commit 1fdc360
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/servicebus/service-bus/src/core/batchingReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export class BatchingReceiver extends MessageReceiver {
}
if (brokeredMessages.length === maxMessageCount) {
finalAction();
} else {
addCreditAndSetTimer(true);
}
};

Expand Down Expand Up @@ -361,10 +363,13 @@ export class BatchingReceiver extends MessageReceiver {
// number of messages concurrently. We will return the user an array of messages that can
// be of size upto maxMessageCount. Then the user needs to accordingly dispose
// (complete,/abandon/defer/deadletter) the messages from the array.
this._receiver!.addCredit(maxMessageCount);
this._receiver!.addCredit(1);
let msg: string = "[%s] Setting the wait timer for %d seconds for receiver '%s'.";
if (reuse) msg += " Receiver link already present, hence reusing it.";
log.batching(msg, this._context.namespace.connectionId, idleTimeoutInSeconds, this.name);
if (totalWaitTimer) {
clearTimeout(totalWaitTimer);
}
totalWaitTimer = setTimeout(
actionAfterWaitTimeout,
(idleTimeoutInSeconds as number) * 1000
Expand Down

0 comments on commit 1fdc360

Please sign in to comment.