Databases Reference
In-Depth Information
Configuring the SRP connector
The first step is to configure the Maven dependencies of the SRP Redis connector. We
can configure the required dependencies by following these steps:
1.
Exclude the transitive Jedis dependency from our build.
2.
Add the SRP connector as a dependency.
This leads into the following dependency declarations:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.0.1.RELEASE</version>
<exclusions>
<exclusion>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.spullara.redis</groupId>
<artifactId>client</artifactId>
<version>0.2</version>
</dependency>
The second step is to configure the Redis connection factory bean. The correct
connection factory bean class for the SRP connector is SrpConnectionFactory , and
it has the following configuration properties:
Property
Description
hostName
The hostname of the used Redis server.
port
The port of the used Redis server.
We can configure the SRP connector by writing an implementation to the
redisConnectionFactory() method. Our implementation has the following steps:
1. Create a new SrpConnectionFactory object.
2. Configure the Redis connection factory bean.
3.
Return the created object.
Search WWH ::




Custom Search