Skip to content

Eager initialization of LettuceConnectionFactory configured for Redis Cluster causes ClassCastException #2186

Closed
@sangeethaPrem

Description

@sangeethaPrem

Hi,

 

When I try to call the initConnection() on my clustered redis, i get the error java.lang.ClassCastException: io.lettuce.core.cluster.StatefulRedisClusterConnectionImpl cannot be cast to io.lettuce.core.api.StatefulRedisConnection

                at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:975)

 

looking at the code it seems like the class cast is only for the StatefulRedisConnection, where as the validateConnection() supports both StatefulRedisConnection and StatefulRedisClusterConnection.

 

any one faced this before? on how to achieve this?
We are doing lazy initialisation to the redis cluster.
Please help.
 

Thanks.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions