googleapis / nodejs-pubsub

Node.js client for Google Cloud Pub/Sub: Ingest event streams from anywhere, at any scale, for simple, reliable, real-time stream analytics.
https://cloud.google.com/pubsub/
Apache License 2.0
517 stars 228 forks source link

Calling Subscription.setOptions won't update the maxStreams count #1722

Closed feywind closed 1 year ago

feywind commented 1 year ago

Due to other recent changes (https://github.com/googleapis/nodejs-pubsub/issues/1712), the MessageStream class will only decide how many streams to use when it's constructed, so this setting will only work if passed to pubsub.subscription(). MessageStream.fillStreams() needs to pay attention to those config changes.

feywind commented 1 year ago

There's a fix in progress for this one.

feywind commented 1 year ago

We've decided not to pursue this fix, so I'll give some more context on the issue. Currently createSubscription() automatically makes a Subscription object and doesn't allow you to pass options for things like maxStreams. So the only way to create and also set that is to create, close, then open again with options.

Will be looking for another way to handle this case.

feywind commented 1 year ago

Just closing this in favour of v2 changes.