You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There may be a reason for this, but why doesn't there exist a composite item reader? It would be useful to chain different readers in the same way as CompositeItemWriter and CompositeItemProcessor. There's a MultipleResourceItemReader but I'm wondering why does the only reader which uses this delegate pattern have the restriction of being "ResourceAware"?
fmbenhassine
changed the title
Simple CompositeItemReader analagous to CompositeItemWriter and CompositeItemProcessor [BATCH-2857]
Simple CompositeItemReader analagous to CompositeItemWriter and CompositeItemProcessor
Sep 15, 2023
There may be a reason for this, but why doesn't there exist a composite item reader? It would be useful to chain different readers in the same way as CompositeItemWriter and CompositeItemProcessor.
I couldn't find any context about why there is no composite item reader, but I guess the main reasons are how to respect the "forward-only" contract of an item reader and how to deal with restartability. Similar to the composite writer, a composite reader could delegate reading items to a list of delegates in their registration order (once a delegate returns null, it moves to the next delegate, and so on), but making this kind of composition restartable is quite challenging.
An example of such a composite item reader can be found here. I would be grateful for anyone who gives it a try and share feedback here. A typical use case for this is reading the same data from different datasources for aggregation (the example shows a composite reader that delegates to 3 readers, reading the same data from two files and a database table).
There's a MultipleResourceItemReader but I'm wondering why does the only reader which uses this delegate pattern have the restriction of being "ResourceAware"?
I see no obvious reason for that, but since items could come from different resources, one should probably be able to know the original resource from which an item was read.
Elliot Korte opened BATCH-2857 and commented
There may be a reason for this, but why doesn't there exist a composite item reader? It would be useful to chain different readers in the same way as CompositeItemWriter and CompositeItemProcessor. There's a MultipleResourceItemReader but I'm wondering why does the only reader which uses this delegate pattern have the restriction of being "ResourceAware"?
No further details from BATCH-2857
The text was updated successfully, but these errors were encountered: