Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.subscribe()


        try {
          logger.info("Connecting to redis host=" + redisHost);
          Jedis jedis = new Jedis(redisHost);

          logger.info("Subscribing to redis channel " + redisChannel);
          jedis.subscribe(jedisPubSub, redisChannel);
          logger.info("Subscribe returned, closing down");
          jedis.quit();
        } catch (Exception e) {
          logger.error("Redis subscription had an error " + e.getMessage());
          fail("redis subscribe hit an error " + e.getMessage());
View Full Code Here


    public void run() {
        while (!stopFlag.get()) {
            Jedis jedis = manager.getPool().getResource();
            try {
                log.debug("Subscribed to " + RedisSessionKeys.getSessionChannel());
                jedis.subscribe(pubSub, RedisSessionKeys.getSessionChannel());
                log.debug("Done.");

                manager.getPool().returnResource(jedis);
            } catch (Throwable e) {
                manager.getPool().returnBrokenResource(jedis);
View Full Code Here

        }
      }
     
    };
   
    jedis.subscribe(pubSub, CHANNEL);
  }
 
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.