Redis Windows installation:
- Go To : https://github.com/MicrosoftArchive/redis/releases
- Download latest release msi and run it to install Redis
Start Redis on Windows:
I installed Redis at location D:\RedisOpen command prompt and goto Redis installation directory in our case
cd D:\RedisThen execute command :
D:\Redis>redis-server.exeNow redis is running on default port 6379
Redis CLI
Open command prompt and goto Redis installation directory in our case cd D:\RedisThen execute command :
D:\Redis>redis-cli.exeOn our application strtup we are createing a key SEASON with value WINTER.
to test the expiry key event listner
in CLI set the expiry for the key SEASON for e.g. 10 sec with command
EXPIRE SEASON 10
after 10 seconds SEASON key wil expire and you will get line : INSIDE EVENT EXPIRY HANDLER --------------------------- printed on your console which is written inside lsitnet event handler.
Note : Tpo enable key expiry notifications we need to execute the command
redis-cli config set notify-keyspace-events KEA