Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"message" Event is not fired in Cluster mode #54

Closed
dg3feiko opened this issue Jun 2, 2015 · 2 comments
Closed

"message" Event is not fired in Cluster mode #54

dg3feiko opened this issue Jun 2, 2015 · 2 comments
Labels

Comments

@dg3feiko
Copy link

dg3feiko commented Jun 2, 2015

Problem should be here:

https://github.com/luin/ioredis/blob/master/lib/redis/prototype/parser.js#L78

this.listeners('message').length is 0

I tried same piece of code in single redis mode and it worked.

Here is my snippet:

var cluster = new Redis.Cluster(
    [
        {
            port: 30001,
            host: '127.0.0.1'
        }
    ]);


cluster.subscribe('news', function (err, count) {
    // this is called
});



cluster.on('message', function (channel, message) {
        // this is not fired
    console.log('Receive message %s from channel %s', message, channel);
});

I publish message via redis-cli

PUBLISH news something
@luin luin added the bug label Jun 2, 2015
luin added a commit that referenced this issue Jun 2, 2015
@luin
Copy link
Collaborator

luin commented Jun 2, 2015

Codes in the master branch should fix this issue. I'm implementing auto-resubscribe and doing more tests before releasing a new version.

@dg3feiko
Copy link
Author

dg3feiko commented Jun 5, 2015

it works now, thanks

@dg3feiko dg3feiko closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants