Example usage for org.springframework.data.redis.connection RedisConnection setClientName

List of usage examples for org.springframework.data.redis.connection RedisConnection setClientName

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection setClientName.

Prototype

void setClientName(byte[] name);

Source Link

Document

Assign given name to current connection.

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Assign given name to current connection.
 * /*w w  w  .j  a  v  a2 s. c  o m*/
 * @param name name
 * @since 1.3
 */
public static void setClientName(byte[] name) {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.setClientName(name);
            return null;
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Assign given name to current connection.
 * //  ww w .jav a2  s . co m
 * @param name name
 * @since 1.3
 */
public void setClientName(byte[] name) {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.setClientName(name);
            return null;
        }
    });
}