question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pushing 400k messages creates 10m messages to pubsub

See original GitHub issue

I tried to push avro file contents to pubsub (1 record/message). The file had 429 077 records but after the push pubsub graph showed about 10 million messages. Also logged the publish calls and it was called the correct amount of times (429 077). Code is below and it’s highland stream wrapped to promise.

export const avroInBucketToPubSub: AvroInBucketToPubSub = ({
  exportFile,
  inputTopicName,
  validator
}) => {
  const pubsub = new PubSub();
  return new Promise((resolve): void => {
    const inputTopic = pubsub.topic(inputTopicName);
    hl(exportFile.createReadStream().pipe(new streams.BlockDecoder()))
      .filter(row => validator.isValid(row))
      .map(JSON.stringify)
      .map(Buffer.from)
      .each(buff => inputTopic.publish(buff))
      .done(resolve);
  });
};

Environment details

  • OS:
  • Node.js version: v10
  • npm version: 6.11.3
  • @google-cloud/pubsub version: 0.30.1

Steps to reproduce

  1. push over 100k messages without waiting reply

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:38 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anthonymartincommented, Jul 11, 2021

fair, that should be fixed when publisher flow control is implemented as per above discussion

1reaction
kamalaboulhosncommented, Jun 8, 2021

So there is no such thing as publisher-side flow control for cloud that would help the user here. We are in the process of adding publisher flow control to our client libraries and I think there is still outstanding work on node for this. I think that’s the next step to take here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push subscriptions | Cloud Pub/Sub Documentation
In push delivery, Pub/Sub initiates requests to your subscriber application to deliver messages. Key Point: Understand the properties of a push subscription ...
Read more >
pubsub - Go Packages
Package pubsub provides an easy way to publish and receive Google Cloud Pub/Sub messages, hiding the details of the underlying server RPCs.
Read more >
Google Cloud Pub/Sub - Asynchronous Messaging
Pub/Sub accepts a maximum of 1,000 messages in a batch, and the size of a batch can not exceed 10 megabytes. Pub/Sub Core...
Read more >
Unable to receive pushed massages using pubsub
However the push messages are too slow to reach the client, average of 200 seconds from push to receive, seem most of the...
Read more >
Google Cloud PubSub Operators - Apache Airflow
The PubSub topic is a named resource to which messages are sent by publishers. The PubSubCreateTopicOperator operator creates a topic. tests/system/providers/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found