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
Hello,
I'm trying to use keyspace notification along with ReJSON module. I cannot find any information about how to enable this feature. I'm using redigo project (GO language) for accesing Redis database. Enabling keyspace notification for "raw" Redis command is quite simple:
Code above works fine for "original" Redis commands like "SET", "EXPIRE" etc., but doesn't work for ReJSON commands. E.g. "JSON.SET" command doesn't trigger any key event or notification. Could you provide some hints, how to enable this feature? Or there is no support for notifications in the ReJSON?
ReJSON does not generate keyspace notifications - I'm sorry you spent time finding this out. As a workaround, you can call the regular PUBLISH after every update to one of its keys from your Golang code.
@itamarhaber Are there any plans to make ReJSON generate keyspace notifications? I'd like to be able to use that as well.
What's the current rationale behind not generating keyspace notifications? Is it a performance overhead concern or just that somebody needs to do it? If the latter, I may try making a PR myself.
@Berkodev My main concern at the moment is indeed performance - using RedisModule_Call to PUBLISH (twice) had quite an impact iirc. I suggest this should wait for proper resolution in https://github.com/antirez/redis/issues/5668 before implementing it.
Hello just a quick question – the issue mentioned appears to be solved now. Is this issue still relevant or does ReJSON now generate keyspace notifications? Thanks!
Activity
itamarhaber commentedon Nov 5, 2018
Hello @dominiksimek
ReJSON does not generate keyspace notifications - I'm sorry you spent time finding this out. As a workaround, you can call the regular PUBLISH after every update to one of its keys from your Golang code.
Berkodev commentedon Dec 6, 2018
@itamarhaber Are there any plans to make ReJSON generate keyspace notifications? I'd like to be able to use that as well.
What's the current rationale behind not generating keyspace notifications? Is it a performance overhead concern or just that somebody needs to do it? If the latter, I may try making a PR myself.
itamarhaber commentedon Dec 6, 2018
@Berkodev My main concern at the moment is indeed performance - using RedisModule_Call to
PUBLISH(twice) had quite an impact iirc. I suggest this should wait for proper resolution in https://github.com/antirez/redis/issues/5668 before implementing it.github-actions commentedon Sep 12, 2019
Stale issue message
StephenHaney commentedon Jul 16, 2020
Hello just a quick question – the issue mentioned appears to be solved now. Is this issue still relevant or does ReJSON now generate keyspace notifications? Thanks!
ajvirgona commentedon Jul 31, 2020
Also interested in keyspace events on JSON keys. Any update on this?
gkorland commentedon Mar 9, 2022
ref #317
xino1010 commentedon Oct 24, 2023
Is this working?
I have the flag
notify-keyspace-events KEA.I'm using the latest version of the node-redis package and the keyevent is not received in the subscriber.
Only works with primitive values
await client.set("foo", "bar");Sokharev commentedon Feb 21, 2024
it works now, it's not reflected in docs but you should just subscribe with this pattern:
"__keyevent@0__:json.set"