Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling setOptions on subscriber does not take effect #1879

Open
dermasmid opened this issue Feb 4, 2024 · 1 comment · May be fixed by #1880
Open

calling setOptions on subscriber does not take effect #1879

dermasmid opened this issue Feb 4, 2024 · 1 comment · May be fixed by #1880
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@dermasmid
Copy link

dermasmid commented Feb 4, 2024

if changing flowControl settings after calling .on they dont not get into effect

const subscription = pubSubClient.subscription(subscriptionNameOrId);
const messageHandler = message => {

  message.ack();
};

subscription.on('message', messageHandler);

// does not have any effect on flow control
subscription.setOptions({
flowControl: {
          maxMessages: 1,
          allowExcessMessages: true,
 }
})

@dermasmid dermasmid added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 4, 2024
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Feb 4, 2024
@dermasmid dermasmid linked a pull request Feb 4, 2024 that will close this issue
@swarmiakimmo
Copy link

I was able to confirm the bug by testing the client with a local script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants