Skip to content

Return AbstractRedisClient from LettuceConnectionFactory [DATAREDIS-1170] #1745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jun 16, 2020 · 2 comments
Assignees
Labels
in: lettuce Lettuce driver type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Ramsey Lubbat opened DATAREDIS-1170 and commented

The RedisClient created by LettuceConnectionFactory is private. It would be helpful to expose it by adding a public getter.

According to its own documentation:

RedisClient is an expensive resource. It holds a set of netty's io.netty.channel.EventLoopGroup's that use multiple threads. Reuse this instance as much as possible or share a ClientResources instance amongst multiple client instances.

There are some third party libraries that interface with RedisClient. In projects using spring-data-redis RedisTemplate and such libraries, it is inefficient to configure a new RedisClient, even if we do so using some of the configuration from a configured LettuceConnectionFactory. Exposing the RedisClient created and used by LettuceConnectionFactory simplifies code and utilizes resources more efficiently.

 


Affects: 2.2.8 (Moore SR8)

3 votes, 4 watchers

@spring-projects-issues
Copy link
Author

Mark Paluch commented

We could expose `AbstractRedisClient getRedisClient(). The client instance can be either RedisClientorRedisClusterClient`

@spring-projects-issues
Copy link
Author

Ramsey Lubbat commented

That would work, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: lettuce Lettuce driver type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants