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.

Auto reconnect if writer failed to connect to NSQ

See original GitHub issue

Once it is disconnected from NSQ(Manually kill the NSQ server), the ‘closed’ event has been triggered in the writer. Then start NSQ server, again. But writer failed to reconnect the server. It throws following error

2015-04-20T10:35:58.359Z - error: Error: No active Writer connection to send messages
    at Writer.publish (/Users/guest/myserver/node_modules/nsqjs/lib/writer.js:99:13) 

It will be great if you have auto reconnect in the Writer. Is there any other method to do it?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:4
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
whtiehackcommented, Jan 9, 2019

@dudleycarr when resolve this issue?

2reactions
thomasmodeneiscommented, Jun 16, 2016

I’m also facing same problems here:

[0] Writer closed
[0] events.js:154
[0]       throw er; // Unhandled 'error' event
[0]       ^
[0] 
[0] Error: read ECONNRESET
[0]     at exports._errnoException (util.js:856:11)
[0]     at TCP.onread (net.js:546:26)

@oaleynik this retry project is real nice, thanks for the tip. Only missing now is buffer the incoming messages as you just mentioned! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempt to reconnect to NSQ after clean close - Stack Overflow
I've created an NSQ producer in my Go microservice and I'm trying to create a method for it to attempt to reconnect after...
Read more >
Publishing messages in parallel causes Not Connected errors
Hey, We have a cluster of NSQ with a lot of throughput - several daemons that consume a message from the queue, process...
Read more >
NSQ Docs 1.2.1 - Building Client Libraries
Client libraries should automatically handle reconnection as follows: If the consumer is configured with a specific list of nsqd instances, reconnection should ...
Read more >
gnsq Documentation - Read the Docs
The Consumer will handle backing off of failed messages up to a configurable ... automatically reconnecting to dropped connections.
Read more >
go-nsq - Go Packages
Message) error { if len(m.Body) == 0 { // Returning nil will automatically send a FIN command to NSQ to mark the message...
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