From 9f3cb6131daca1fd518b210f5c8383b4f362b654 Mon Sep 17 00:00:00 2001 From: Cheskel Twersky Date: Wed, 6 Nov 2024 11:34:20 +0200 Subject: [PATCH 1/2] correct max --- src/message-stream.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/message-stream.ts b/src/message-stream.ts index 073658382..abefb792d 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -318,7 +318,7 @@ export class MessageStream extends PassThrough { streamAckDeadlineSeconds: this._subscriber.ackDeadline, maxOutstandingMessages: this._subscriber.useLegacyFlowControl ? 0 - : this._subscriber.maxMessages, + : this._subscriber.maxMessages / this._streams.length, maxOutstandingBytes: this._subscriber.useLegacyFlowControl ? 0 : this._subscriber.maxBytes, @@ -328,7 +328,6 @@ export class MessageStream extends PassThrough { 'x-goog-request-params': 'subscription=' + this._subscriber.name, }, }; - const stream: PullStream = client.streamingPull({deadline, otherArgs}); this._replaceStream(index, stream); stream.write(request); From f351569537abd1b1fa0f9282dcafe98cccc39df2 Mon Sep 17 00:00:00 2001 From: Cheskel Twersky Date: Wed, 6 Nov 2024 11:39:28 +0200 Subject: [PATCH 2/2] bytes too --- src/message-stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/message-stream.ts b/src/message-stream.ts index abefb792d..2b21e13dd 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -321,7 +321,7 @@ export class MessageStream extends PassThrough { : this._subscriber.maxMessages / this._streams.length, maxOutstandingBytes: this._subscriber.useLegacyFlowControl ? 0 - : this._subscriber.maxBytes, + : this._subscriber.maxBytes / this._streams.length, }; const otherArgs = { headers: {