spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Add item reader/writer for Redis

Open fmbenhassine opened this issue 4 years ago • 4 comments
trafficstars

Add support to read data from and write data to Redis based on Spring Data Redis.

Reference: https://stackoverflow.com/questions/24703753/does-spring-batch-have-a-redis-itemreader-in-the-roadmap

fmbenhassine avatar Jul 02 '21 15:07 fmbenhassine

Hello @benas, I would like to work on this. Any chance that you can provide some guidance ?

santfirax avatar Jul 02 '21 17:07 santfirax

@santfirax Thank you for your offer to help! The writer could be based on KeyValueItemWriter for consistency with other key/value writers. For the reader, I need some time to reflect on the best way to read data from Redis (ie make the reader use a RedisTemplate or a Redis Repository). But I'm open to ideas, so you are welcome to open a PR and we can discuss it there.

fmbenhassine avatar Jul 05 '21 08:07 fmbenhassine

Hello @benas I've created a PR for the write using RedisTemplate. https://github.com/spring-projects/spring-batch/pull/3961. Any chance that you can take a look at it ?

santfirax avatar Jul 06 '21 21:07 santfirax

Hello, @benas. I have an idea about RedisRepositoryItemReader / RedisRepositoryItemWriter. They are based on RedisRepository. So ItemReader can read data that saved by RedisRepository. And ItemWriter can write data through RedisRepository. I would like to open a PR for this. Is there anything I should know?

MinJunKweon avatar Dec 30 '21 15:12 MinJunKweon

Hi, @fmbenhassine. I wonder if this issue is handled by anyone. If not, may I try on this issue?

seonWKim avatar Jun 28 '23 06:06 seonWKim

This was resolved in 1bd0e0c. Thanks @santfirax for the PR!

For the item reader, please join the discussion in #4446.

fmbenhassine avatar Sep 12 '23 20:09 fmbenhassine

@fmbenhassine Thank you! I'll join above discussion.

seonWKim avatar Sep 13 '23 04:09 seonWKim