1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| class MyRedisMessageConsumer extends JedisPubSub{
@Override public void onMessage(String channel, String message) { System.out.println(channel+ "\t" + message); }
@Override public void onPMessage(String pattern, String channel, String message) { System.out.println("pattern:"+pattern); System.out.println("channel:"+channel); System.out.println("message:"+message); } @Override public void onPSubscribe(String arg0, int arg1) {} @Override public void onPUnsubscribe(String arg0, int arg1) {} @Override public void onSubscribe(String arg0, int arg1) {} @Override public void onUnsubscribe(String arg0, int arg1) {} }
|