Selective listening of redis messages

10 views
Skip to first unread message

Kashyap Mhaisekar

unread,
Jul 29, 2015, 2:19:46 PM7/29/15
to redi...@googlegroups.com
Hi,
Is there a way in which the Redis subscribe can selectively listen to the messages  coming on a channel?

E.g., 
If there is a channel - CHAN1 and two subscribers (S1, S2) both subscribing to this channel. CHAN1 can spew out messages say M1, M2, ... Mn.
I want the S1 to process only M1, M3 etc (odd numbers) while the S2 should process even numbers (M2, M4...)

Thanks
Kashyap

Jan-Erik Rediger

unread,
Jul 29, 2015, 2:24:05 PM7/29/15
to redi...@googlegroups.com
Nope, all clients subscribed to a specific channel always receive all
the messages.
To split them up, use two channels: chan:even and chan:odd and teach
your application to publish to the correct one (or PSUBSCRIBE to
chan[02468] if you know to not go over 10)
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

Kashyap Mhaisekar

unread,
Jul 29, 2015, 5:52:35 PM7/29/15
to redi...@googlegroups.com, Jan-Erik Rediger

Thanks Jan.

Reply all
Reply to author
Forward
0 new messages