PUB / SUB test failing?

21 views
Skip to first unread message

JL

unread,
Oct 5, 2016, 5:08:13 PM10/5/16
to Redis DB
hi there. 

I'm trying to follow the suggestion for testing / learning about redis' pub/sub model here:  http://redis.io/topics/notifications

This is what I've done in my first terminal window: 


redis
-db-1:~# redis-cli config set notify-keyspace-events KEA
OK
redis
-db-1:~# redis-cli --csv psubscribe '_key*_:*'
Reading messages... (press Ctrl-C to quit)
"psubscribe","_key*_:*",1


And then, in a second terminal screen, I've tried this: 

127.0.0.1:6379> HMSET widget:123 uri 1234@test.net
OK
127.0.0.1:6379> HMSET widget:223 uri 1234@test.net
OK
127.0.0.1:6379> HGET  widget:223 uri
"12...@test.net"
127.0.0.1:6379> SET killme abc@test.com

OK

But none of these commands in terminal 2 are triggering things in terminal 1.  Should I be expecting to see things in terminal 1?  I would have thought so.  But maybe I've misunderstood something or skipped a step? 
Any help would be appreciated.




JL

unread,
Oct 6, 2016, 8:29:23 AM10/6/16
to Redis DB
Hi y'all.  
Figured it out.  It's actually a double underscore that's needed on either side of the word "key".
So I changed this: 
'_key*_:*'

to 

'__key*__:*'


Reply all
Reply to author
Forward
0 new messages