Skip to content
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

Add a Jedis connector #248

Closed
adamnation opened this issue Jun 1, 2021 · 7 comments
Closed

Add a Jedis connector #248

adamnation opened this issue Jun 1, 2021 · 7 comments

Comments

@adamnation
Copy link

adamnation commented Jun 1, 2021

Adding a Jedis Redis Client Provider

  1. Jedis is the leading Redis client and supports TLS to connect to AWS and Azure with encryption in transit.
  2. We use Azure and we would like our Redis cache activity to be encrypted in transit, but that is not possible with the current Redis Scala library which you use as a Redis client.
  3. I propose adding another connector which would allow developers to use either RedisScala or Jedis for communicating with a Redis cluster.
  4. Also adding a SSL/TLS secure option to the connection config would be required to support encryption in transit.
  5. Add a bridge to the AKKA system for the new connector.
  6. I propose adding a new redis provider setting to the configuration file:
{
   play.cache.redis.connector: jedis
   ssl: true
}

This would be used to determine the connector at run time and either connect using redisscala (default) or jedis. Additionally, add ssl config value that would default to false. It would only do something when jedis is selected, and maybe throw config exception if redisscala is selected.

@KarelCemus
Copy link
Owner

KarelCemus commented Jun 2, 2021

This would require significant work and long-term support since Jedis is single-threaded and there must be built a bridge to Akka actor system and additional support of features you list. Unfortunately, I don't have that much time either to implement it or to support it. Are you willing to implement the alternative connector and support it?

@adamnation
Copy link
Author

I may be able to do it in my spare time. Do you have any guidance where I should start to build the bridge in the project?

@adamnation adamnation changed the title Add a Jedis provider Add a Jedis connector Jun 2, 2021
@KarelCemus
Copy link
Owner

Basically, all you need to do is to implement RedisConnector trait, which encapsulates the API. I briefly checked Jedis and if I am not wrong, it seems the implementation is blocking. Therefore I suggest implementing an Akka actor wrapping this behavior and then linking it via the connector trait just like the rediscala implementation does. Finally, it can be integrated via compile-time or runtime DI, which is quite simple then.

@alejandrod-f
Copy link

We have having a similar issue as we need TLS. The rediscala library looks dead and I'm not sure is a good idea to just migrate to something else

@KarelCemus
Copy link
Owner

Yes, I agree that existing connector is dead and it should be migrated to something more alive, maybe jedis or something. However, given that Play itself seems to be dead, it is questionable whether it is efficient to add more features to this at this moment.

Honestly, I am not using play for very long time so this is not on my todolist. However, if anybody is willing to contribute, I'd be more than happy merging it and releasing new version.

@alejandrod-f
Copy link

alejandrod-f commented Jul 7, 2023

Thanks for the answer. After spending some hours I decided to give redisson a try (which we were already using).
Is too much work updating the rediscache or this project I think.

Basically implement a custom AsyncCacheApi . That should be easy.
There are other things that worries me, we are planning on moving to scala 3 and dead projects are not good.
Play is going to have support for scala3 soon. So, we are good there.

Will see how it goes. Thanks anyways

@KarelCemus
Copy link
Owner

KarelCemus commented May 5, 2024

#301 replaces the current Rediscala connector with Lettuce. I hope that this one will last longer than all previous connectors. 🤞

Lettuce should hopefully provide all required features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants