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 expire capability for SET calls to Redis #26

Open
uzunbaz opened this issue Feb 6, 2020 · 8 comments
Open

Add expire capability for SET calls to Redis #26

uzunbaz opened this issue Feb 6, 2020 · 8 comments

Comments

@uzunbaz
Copy link

uzunbaz commented Feb 6, 2020

Currently, there is no capability to configure an expiration for records pushed to Redis by this connector. It will be nice to have a config to set the expire time for the records.

In other words, instead of SET key value, it should call SET key value [EX seconds|PX milliseconds] where the time duration is configurable with the json file passed to the connector.

@jcustenborder
Copy link
Owner

@uzunbaz What are you thinking? Just a configuration setting with the number of milliseconds until an expiration and then applying that to all SET calls?

@uzunbaz
Copy link
Author

uzunbaz commented Feb 6, 2020

Yes, something like that. I checked the source code briefly and looks like MSET async command is used for setting the keys. However, Redis MSET command does not take any expiration ttl as a parameter (there are tickets/discussions that requires this, e.g. : redis/redis#5867)

So, we can either use SET EX instead of MSET or have another call for expiration after MSET, lettuce api has a function for expire: AbstractRedisAsyncCommands.expire(...) (link to lettuce source).

@mbrembilla
Copy link

mbrembilla commented Mar 11, 2022

Hi, are there any news about this enhancement?
It would be really helpful to have a way to set the expire time on the keys.

@vinaygopalkrishnan
Copy link

Hi,
Is this enhancement implemented or planned? It would be very helpful to have this for cache maintenance.

@gcaragea
Copy link

Bumping this up, having this functionality would enable our use-case for caching. Much needed please!

@andlien
Copy link

andlien commented Apr 27, 2022

Would also love to have this implemented. Perhaps even with the possibility to set it dynamically with a kafka-header? Which could be added to the sink-configuration?

@jcustenborder
Copy link
Owner

Ignoring the fact that we need to use SET instead of MSET how would we want to calculate the the value for EX? As a static config setting? So something like EX 60 with 60 being pulled from config. Another alternative would be EXAT 19871341 calculated based on the timestamp?

@varunpathania
Copy link

Hi, was this enhancement implemented?

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

7 participants