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.

Not receiving all messages

See original GitHub issue
  • OS: Google Container Engine (Kubernetes)
  • Node.js version: gcr.io/google_appengine/nodejs
  • npm version:
  • @google-cloud/pubsub version: 0.16.2

I have a very simple subscription on a topic that runs in Container Engine. The code is the same as your examples:

const pubsub = require('@google-cloud/pubsub')();

const projectId = process.env.GOOGLE_CLOUD_PROJECT;
const topic = pubsub.topic('projects/' + projectId + '/topics/security-logs');
const subscription = topic.subscription('projects/' + projectId + '/subscriptions/securitySubscription');

subscription.on('error', function (err) {
    "use strict";
    console.error("Subscription error: " + err);
});

function onMessage(message) {
    "use strict";
    // Called every time a message is received.
    logger.log("Subscription message received: " + JSON.stringify(message));
    const data = Buffer.from(message.data).toString('utf-8');
    logger.log("message.data: " + data);
    message.ack();
}

subscription.on('message', onMessage);

The problem is that not all messages are received. I would say a little more than 50% are.

I see in my logs that messages are successfully sent by publishers (I get messageIds) but the subscription does not get them all. I have only one subscriber.

Any idea what might be wrong ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sharif9876commented, Oct 17, 2019

@callmehiphop That seems to have fixed it! Thanks!

0reactions
callmehiphopcommented, Oct 17, 2019

@sharif9876 awesome, thanks for stopping by and letting us know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix problems sending, receiving or connecting to Messages
Fix problems sending or receiving messages from specific contacts · Delete the contact and add it again. · Check if you blocked them....
Read more >
How to Fix It When You're Not Receiving Texts on Android
How to Fix Androids Not Receiving Texts · Check for blocked numbers. · Check the network connection. · Disable Airplane mode. · Reboot...
Read more >
Not receiving text on your phone: Here's how to fix - India Today
Steps to follow when Android is not receiving text messages: · Reboot your phone · Check the reception · Clear the cache from...
Read more >
Why Am I Not Receiving Text Messages on My iPhone?
1. Start the Settings app. · 2. Tap "Messages," then tap "Send & Receive." · 3. In the "You can receive iMessages" section,...
Read more >
If you can't send or receive messages on your iPhone or iPad
with an alert that says Not Delivered, follow these steps: ... You can set up Messages so that it automatically tries to send...
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