@Override public Long lPush(byte[] key, byte[]... values) { return convertAndReturn(delegate.lPush(key, values), identityConverter); }
@Override public Long leftPush(K key, V value) { byte[] rawKey = rawKey(key); byte[] rawValue = rawValue(value); return execute(connection -> connection.lPush(rawKey, rawValue), true); }
@Override public Long leftPushAll(K key, V... values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long leftPushAll(K key, Collection<V> values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long lPush(byte[] key, byte[]... values) { return redisConnection.lPush(key, values); }
@Override protected boolean doRequest(String address, String message) { redisTemplate.execute((RedisCallback<Void>) connection -> { connection.lPush(address.getBytes(), message.getBytes()); return null; }); return true; }
@Override public Long lPush(byte[] key, byte[]... values) { return convertAndReturn(delegate.lPush(key, values), identityConverter); }
@Override public boolean request(String address, String message) { logger.trace("[MQ] request {}:{}", address, message); redisTemplate.execute((RedisCallback<Void>) connection -> { connection.lPush(address.getBytes(), message.getBytes()); return null; }); return true; }
@Override public Long lPush(byte[] key, byte[]... values) { return convertAndReturn(delegate.lPush(key, values), identityConverter); }
@Override public void request(String address, String message) { logger.trace("[MQ] request {}:{}", address, message); RedisConnection connection = null; try { connection = redisTemplate.getConnectionFactory().getConnection(); connection.lPush(address.getBytes(), message.getBytes()); } finally { if (connection != null && !connection.isClosed()) { connection.close(); } } }
@Override public Long leftPush(K key, V value) { byte[] rawKey = rawKey(key); byte[] rawValue = rawValue(value); return execute(connection -> connection.lPush(rawKey, rawValue), true); }
@Override public Long leftPushAll(K key, V... values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long leftPushAll(K key, V... values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long leftPushAll(K key, Collection<V> values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long doInRedis(RedisConnection connection) throws DataAccessException { RedisSerializer<String> serializer = redisTemplate.getStringSerializer(); long count = connection.lPush(serializer.serialize(key), serializer.serialize(value)); return count; } });
@Override public Long leftPush(K key, V value) { byte[] rawKey = rawKey(key); byte[] rawValue = rawValue(value); return execute(connection -> connection.lPush(rawKey, rawValue), true); }
@Override public Long leftPushAll(K key, Collection<V> values) { byte[] rawKey = rawKey(key); byte[][] rawValues = rawValues(values); return execute(connection -> connection.lPush(rawKey, rawValues), true); }
@Override public Long doInRedis(RedisConnection connection) throws DataAccessException { RedisSerializer<String> serializer = redisTemplate.getStringSerializer(); long count = connection.lPush(serializer.serialize(key), serializer.serialize(value)); return count; } });