A general set/get command
1 | package com.mycompany.app; |
##publish/subscribe command
setup the redis connection for pubsub
1 |
|
###add the listener
RedisPubSubListener is the interface, we need to implement a listener class
1 |
|
To test the publish/subscribe command , the main thread shouldn’t exit quickly,
int the main() we can add something code like this, to make applicaiton always in running state.
1 | while (true) { |