topic.setPublishOptions fails to change batching settings
See original GitHub issueEnvironment details
- OS: Linux
- Node.js version: 12.x
- npm version: 6.14.5
@google-cloud/pubsub
version: 2.5.0
Steps to reproduce
- Create a topic
- Call
setPublishOptions
on the topic to change the batching settings - Call
publish
orpublishJSON
on the topic to send a message - Observe that new batching settings are not used
Probable root cause: publisher.setOptions
doesn’t propagate the new batching settings to its this.queue
/ this.orderedQueues
: https://github.com/googleapis/nodejs-pubsub/blob/master/src/publisher/index.ts#L245
Workaround: always include batching options when creating the topic object.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Publish with batching settings | Cloud Pub/Sub Documentation
Creates a publisher client with custom batching settings and uses it to publish some messages.
Read more >@google-cloud/pubsub | Yarn - Package Manager
BREAKING: Subscription options have changed. (#388). Before const subscription = topic.subscription('my-sub', { batching: { maxMilliseconds: 100, } ...
Read more >Batching PubSub requests - node.js - Stack Overflow
If you wanted to batch messages, then you'd need to keep hold of the publisher and call publish on it multiple times.
Read more >https://raw.githubusercontent.com/googleapis/nodej...
... (2021-08-11) ### Bug Fixes * **pubsub:** replace IAMPolicy in API config ... Features * update publisher options all the way through the...
Read more >Fine-tuning Pub/Sub performance with batch and flow control ...
A batch, within the context of Cloud Pub/Sub, refers to a group of one or more messages published to a topic by a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There’s a PR up that should take care of propagating out the new defaults. It also adds a method to return the default config, so you can edit it and then set it.
I kind of also want to make a separate PR for being able to partially update the config, but hopefully this will get everyone going.
I’m planning to look into this properly this week.