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 item reader for Redis #4446

Closed
fmbenhassine opened this issue Sep 12, 2023 · 1 comment
Closed

Add item reader for Redis #4446

fmbenhassine opened this issue Sep 12, 2023 · 1 comment

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Sep 12, 2023

This issue is to add an item reader for Redis based on Spring Data Redis. The tricky part is how to define the set of keys that the reader should iterate over:

  • KEYS/SCAN are the most obvious choices (as Spring Data Redis provides iterable cursor-based APIs for these commands)
  • Provide a key for which the value is an iterable data structure (list, set, stream, etc) and make the reader return items from that value

This is key to correctly design and implement the item reader (or readers?) for Redis.


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

@fmbenhassine
Copy link
Contributor Author

RedisTemplate#scan is the API that fits well with an item reader as it returns a cursor over a set of keys specified by a ScanOption. Therefore, the new RedisItemReader should be based on those APIs.

As there is no iterable common base type for ListOperations, SetOperations, etc provided by Spring Data Redis, there is no plan for now to create an item reader per data structure (RedisListItemReader, RedisSetItemReader, etc). This is left to the user to implement in a custom reader.

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

1 participant