Example usage for org.springframework.data.redis.core RedisConnectionUtils bindConnection

List of usage examples for org.springframework.data.redis.core RedisConnectionUtils bindConnection

Introduction

In this page you can find the example usage for org.springframework.data.redis.core RedisConnectionUtils bindConnection.

Prototype

public static RedisConnection bindConnection(RedisConnectionFactory factory) 

Source Link

Document

Binds a new Redis connection (from the given factory) to the current thread, if none is already bound.

Usage

From source file:org.springframework.integration.redis.outbound.RedisCollectionPopulatingMessageHandler.java

private void processInPipeline(PipelineCallback callback) {
    RedisConnection connection = RedisConnectionUtils.bindConnection(redisTemplate.getConnectionFactory());
    try {//from   w  w  w .jav  a2 s. c  om
        connection.openPipeline();
        callback.process();
    } finally {
        connection.closePipeline();
        RedisConnectionUtils.unbindConnection(redisTemplate.getConnectionFactory());
    }
}