Example usage for org.springframework.data.redis.connection.lettuce LettuceConnectionFactory setClientName

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

Introduction

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

Prototype

@Deprecated
public void setClientName(@Nullable String clientName) 

Source Link

Document

Sets the client name used by this connection factory.

Usage

From source file:org.springframework.data.redis.connection.lettuce.LettuceConnectionFactoryTests.java

@Test // DATAREDIS-576
public void getClientNameShouldEqualWithFactorySetting() {

    LettuceConnectionFactory factory = new LettuceConnectionFactory(new RedisStandaloneConfiguration());
    factory.setClientResources(LettuceTestClientResources.getSharedClientResources());
    factory.setClientName("clientName");
    factory.afterPropertiesSet();//from  ww w  .  ja  v a 2s .  co m

    ConnectionFactoryTracker.add(factory);

    RedisConnection connection = factory.getConnection();
    assertThat(connection.getClientName(), equalTo("clientName"));

    connection.close();
}