mcollina / mqemitter-redis

Redis-powered MQEmitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emit error event for redis connection failure

rahulbhanushali opened this issue · comments

Hi mcollina,

I have been using aedes for quite sometime with mqemitter-redis and aedes-persistence-redis.
I am trying to handle connection issues in case the redis server goes down or there are network related issues but mqemitter-redis does not expose a method or emit an error event for connection failure.

Can you please help with this?

@rahulbhanushali yes that is missing here.

In mqemitter-mongodb we have a status EventEmitter https://github.com/mcollina/mqemitter-mongodb/blob/master/mqemitter-mongodb.js#L32 on which these types of event are emitted.

Would you like to send a PR?

@mcollina Is it fine if I submit a PR for this issue? I also need this feature.

@jyotman please do!! Thanks!

Cool, just 2 questions -

  1. I was thinking of emitting the connect and error events. Should I emit any other event too?

  2. There are 2 redis connections being made -

this.subConn = new Redis(opts)
this.pubConn = new Redis(opts)

So should I emit events from both these connections?