Skip to content

Instantly share code, notes, and snippets.

@arthurtsang
Created March 24, 2013 22:11
Show Gist options
  • Save arthurtsang/5233783 to your computer and use it in GitHub Desktop.
Save arthurtsang/5233783 to your computer and use it in GitHub Desktop.
calling redis script using Redis Template
template.execute(new RedisCallback<Object>() {
@Override
public Object doInRedis(RedisConnection connection) throws DataAccessException {
Jedis jedis = (Jedis) connection.getNativeConnection();
RedisSerializer<Object> redisSerializer = (RedisSerializer<Object>) template.getHashValueSerializer();
String json = new String( redisSerializer.serialize(value) );
return jedis.eval(UPDATE_OHASH_SCRIPT, 2, listKey, hashKey, id, json);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment