3535import org .springframework .data .redis .cache .RedisCacheManager ;
3636import org .springframework .data .redis .connection .*;
3737import org .springframework .data .redis .core .*;
38+ import org .springframework .data .redis .core .RedisConnectionUtils .RedisConnectionProxy ;
3839import org .springframework .data .redis .core .convert .KeyspaceConfiguration ;
3940import org .springframework .data .redis .core .convert .MappingConfiguration ;
4041import org .springframework .data .redis .core .convert .MappingRedisConverter ;
@@ -157,6 +158,20 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
157158 boundOperationsProxy (BoundStreamOperations .class , classLoader , hints );
158159 boundOperationsProxy (BoundValueOperations .class , classLoader , hints );
159160 boundOperationsProxy (BoundZSetOperations .class , classLoader , hints );
161+
162+ // Connection Splitting
163+ registerRedisConnectionProxy (TypeReference .of (RedisCommands .class ), hints );
164+ registerRedisConnectionProxy (TypeReference .of (RedisGeoCommands .class ), hints );
165+ registerRedisConnectionProxy (TypeReference .of (RedisHashCommands .class ), hints );
166+ registerRedisConnectionProxy (TypeReference .of (RedisHyperLogLogCommands .class ), hints );
167+ registerRedisConnectionProxy (TypeReference .of (RedisKeyCommands .class ), hints );
168+ registerRedisConnectionProxy (TypeReference .of (RedisListCommands .class ), hints );
169+ registerRedisConnectionProxy (TypeReference .of (RedisSetCommands .class ), hints );
170+ registerRedisConnectionProxy (TypeReference .of (RedisScriptingCommands .class ), hints );
171+ registerRedisConnectionProxy (TypeReference .of (RedisServerCommands .class ), hints );
172+ registerRedisConnectionProxy (TypeReference .of (RedisStreamCommands .class ), hints );
173+ registerRedisConnectionProxy (TypeReference .of (RedisStringCommands .class ), hints );
174+ registerRedisConnectionProxy (TypeReference .of (RedisZSetCommands .class ), hints );
160175 }
161176
162177 static void boundOperationsProxy (Class <?> type , ClassLoader classLoader , RuntimeHints hints ) {
@@ -179,4 +194,13 @@ static void boundOperationsProxy(TypeReference typeReference, ClassLoader classL
179194 TypeReference .of ("org.springframework.aop.framework.Advised" ), //
180195 TypeReference .of ("org.springframework.core.DecoratingProxy" ));
181196 }
197+
198+ static void registerRedisConnectionProxy (TypeReference typeReference , RuntimeHints hints ) {
199+
200+ hints .proxies ().registerJdkProxy (TypeReference .of (RedisConnectionProxy .class ), //
201+ typeReference , //
202+ TypeReference .of ("org.springframework.aop.SpringProxy" ), //
203+ TypeReference .of ("org.springframework.aop.framework.Advised" ), //
204+ TypeReference .of ("org.springframework.core.DecoratingProxy" ));
205+ }
182206}
0 commit comments