You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble subscribing.
When I use redisClusterCommand, I get an error saying that I don't have a key and shouldn't do it,
When using redisClusterCommandToNode, the SUBSCRIBE command works fine, but I can't get the publish data with redisClusterGetReply.
What should I do in this case?
The text was updated successfully, but these errors were encountered:
Hi! Subscribe is not yet supported by hiredis-cluster. We want to fix it in the future. See #27.
One possibility to get the published data is to use hiredis directly. You can get the hiredis context from hiredis-cluster like this:
/* Get a node. */nodeIteratoriter;
initNodeIterator(&iter, cc);
redisClusterNode*node=nodeNext(&iter);
/* Another way is * node = redisClusterGetNodeByKey(cc, "some key"); *//* Get the hiredis context, connect if needed */redisContext*c=ctx_get_by_node(cc, node);
/* Use hiredis functions with context c, * for example loop to get all pubsub messages */redisReply*reply=redisCommand(c, "SUBSCRIBE foo");
freeReplyObject(reply);
while (redisGetReply(c, (void*)&reply) ==REDIS_OK) {
// consume messagefreeReplyObject(reply);
}
Hello?
I'm having trouble subscribing.
When I use redisClusterCommand, I get an error saying that I don't have a key and shouldn't do it,
When using redisClusterCommandToNode, the SUBSCRIBE command works fine, but I can't get the publish data with redisClusterGetReply.
What should I do in this case?
The text was updated successfully, but these errors were encountered: