Available Methods
- close ( )
- set ( )
- del ( )
- get ( )
- exists ( )
- expire ( )
- select ( )
- hset ( )
- rpush ( )
- publish ( )
- hget ( )
- lpush ( )
- incr ( )
- sadd ( )
- hdel ( )
- lrange ( )
- setex ( )
- keys ( )
- auth ( )
- hgetAll ( )
- flushAll ( )
- pipelined ( )
- srem ( )
- hmset ( )
- smembers ( )
- scard ( )
- setnx ( )
- connect ( )
- decr ( )
- eval ( )
- multi ( )
- sort ( )
- sismember ( )
- zrangeByScore ( )
- zadd ( )
- hvals ( )
- lpop ( )
- zrange ( )
- rpop ( )
- incrBy ( )
- hmget ( )
- hkeys ( )
- llen ( )
- watch ( )
- brpop ( )
- zrem ( )
- ttl ( )
- linsert ( )
- mget ( )
- configSet ( )
- hexists ( )
- spop ( )
- decrBy ( )
- sdiffstore ( )
- setrange ( )
- zscore ( )
- ltrim ( )
- hlen ( )
- scan ( )
- getSet ( )
- zrevrangeByScoreWithScores ( )
- append ( )
- sdiff ( )
- zcard ( )
- lindex ( )
- subscribe ( )
- rename ( )
- sinter ( )
- lrem ( )
- clientSetname ( )
- persist ( )
- sendCommand ( )
- zrangeWithScores ( )
- zscan ( )
- psubscribe ( )
- zrevrank ( )
- mset ( )
- zrevrangeByScore ( )
- slowlogGet ( )
- flushDB ( )
- sunionstore ( )
- strlen ( )
- disconnect ( )
Related Classes
- java.util.Arrays
- java.util.Collections
- java.util.Date
- java.util.concurrent.TimeUnit
- org.junit.Before
- java.util.UUID
- java.net.URI
- java.util.Map.Entry
- org.junit.Assert
- java.util.Optional
- javax.servlet.http.HttpServletRequest
- com.google.gson.Gson
- org.springframework.context.annotation.Bean
- org.json.JSONObject
- org.apache.commons.lang3.StringUtils
- org.apache.commons.io.IOUtils
- com.google.common.collect.Lists
- org.apache.commons.lang.StringUtils
- org.springframework.util.StringUtils
- com.alibaba.fastjson.JSON
- javax.ws.rs.core.Response
- com.alibaba.fastjson.JSONObject
- redis.clients.jedis.JedisPool
- redis.clients.jedis.JedisPoolConfig
- org.apache.commons.pool2.impl.GenericObjectPoolConfig
Java Code Examples for redis.clients.jedis.Jedis#psubscribe()
The following examples show how to use
redis.clients.jedis.Jedis#psubscribe() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JRedisCache.java From springJredisCache with Apache License 2.0 | 6 votes |
/** * 通常为了适应大多数场景 还是使用这方式订阅吧 * <p/> * 表达式的方式订阅 * 使用模式匹配的方式设置要订阅的消息 订阅得到信息在JedisPubSub的onMessage(...)方法中进行处理 * * @param patterns */ @Override public void psubscribe(final String... patterns) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final byte[][] ps = new byte[patterns.length][]; for (int i = 0; i < ps.length; i++) { ps[i] = SafeEncoder.encode(patterns[i]); } jedis.psubscribe(jRedisBinaryPubSub, ps); } catch (Exception ex) { coverException(ex, jedisPool, jedis); } finally { if (jedis != null && jedis.isConnected()) { jedisPool.returnResource(jedis); if (LOGGER.isDebugEnabled()) { LOGGER.debug("close redis connection-{" + jedis.toString() + "}"); } } } }
Example 2
Source File: JedisUtil.java From scaffold-cloud with MIT License | 5 votes |
/** * 调用jedis的psubscribe()方法 * * @param jedisPubSub * @param patterns */ public static void psubscribe(JedisPubSub jedisPubSub, String... patterns) { Jedis jedis = null; try { jedis = getResource(); jedis.psubscribe(jedisPubSub, patterns); } catch (Exception e) { logger.warn("psubscribe patterns==> {} exception==> {}", patterns, e); } finally { close(jedis); } }
Example 3
Source File: AidrFetcherJsonInputProcessor.java From AIDR with GNU Affero General Public License v3.0 | 5 votes |
public void run() { //this.setMaxLogWritesPerMinute(2); while (true) { if (Thread.interrupted()) return; Jedis redis = null; try { redis = DataStore.getJedisConnection(); Subscriber subscriber = new Subscriber(outputQueueName); redis.psubscribe(subscriber, inputQueueName); redisLoadShedder .put(inputQueueName, new LoadShedder( Integer.parseInt(TaggerConfigurator .getInstance() .getProperty( TaggerConfigurationProperty.PERSISTER_LOAD_LIMIT)), Integer.parseInt(TaggerConfigurator .getInstance() .getProperty( TaggerConfigurationProperty.PERSISTER_LOAD_CHECK_INTERVAL_MINUTES)), true,inputQueueName)); Thread.sleep(60000); } catch (Exception e) { logger.error("RedisInputProcessor", e); } finally { DataStore.close(redis); } } }