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.

Reconnect subscription

See original GitHub issue

When I turn the nats-streaming server on and off, the node-nats-streaming client reconnects. However, the subscription does not continue sending message events. Neither does it send an error event or any other events as far as I can see.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mbaranovskicommented, Sep 4, 2019

Hi @aricart, as I understand to make node-nats-streaming to constantly try to reconnect I need to specify maxAttempts=-1, waitOnFirstConnect=true - with other options as defaults it tries to reconnect about 7-8 times and I receive connection_lost event. Looking at the stan.js code, the line which is preventing the nats-streaming to keep reconnecting is: https://github.com/nats-io/stan.js/blob/master/lib/stan.js#L357

If I set stanMaxPingOut to let’s say 999 it will keep reconnecting until maxpingout reaches 999. Is it correct behaviour and I’m missing something?

Thanks

[EDIT] NATS Streaming version: 0.2.6

Also once the NATS streaming reconnects then I receive connection_lost event with a message: client has been replaced or is no longer registered, I will add that I’m not providing any existing NATS client to the connect method of nats streaming.

0reactions
aricartcommented, Oct 26, 2018

Great - I am going to close this issue if you find something else please reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reconnect-business-pre-subscription-form.pdf - USDA
ReConnect Program Broadband Pre-subscription Form for Other Businesses 1. ReConnect Program: Pre-subscription Form for Other Businesses.
Read more >
Subscriptions - Apollo GraphQL Docs
Unlike queries, subscriptions are long-lasting operations that can change their result over time. They can maintain an active connection to your GraphQL server ......
Read more >
bug: Subscriptions are not re-registered on socket reconnect ...
When the socket connect is lost to the tRPC server and then reconnect subscriptions requests are not automatically sent out again.
Read more >
How to detect disconnect and reconnect for subscription ...
I finally found the solution. It turns out that you can declare a SubscriptionClient first and then insert this into WebSocketLink , rather...
Read more >
Reconnect to your Subscription - Simply Piano 101
Reconnect to your Subscription · For Apple purchases: Make sure your device is logged onto the same Apple ID that purchased the subscription....
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