@Override public void run() { logger.debug("RedisPublisher: {} Starting.", id); Jedis jedis = jedisPool.getResource(); jedis.connect(); logger.debug("RedisPublisher: {} connected.", id); for (int i = 0; i < testCount; i++) { jedis.publish(channel, REDIS_PAYLOAD); tallyMessage(); } logger.debug("Redis Publisher ({}) : Published {} messages", id, testCount); jedis.disconnect(); setComplete(); }
@Override void waitForCompletion() { super.waitForCompletion(); jedis.disconnect(); }