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
A chunk of items is a key concept in the chunk-oriented processing model and is nicely modelled with the org.springframework.batch.core.step.item.Chunk API. This API is used in almost all interfaces/classes related to the implementation of this model (ie ChunkProvider, ChunkProcessor, etc) except for the ItemWriter<T> where a List<? extends T> is used instead. I believe Chunk<T> is a better encapsulation for the chunk of items than a List<? extends T>:
This would make the ItemWriter API more coherent and consistent with the rest of the package. This is obviously a breaking change and requires moving the Chunk API to the infrastructure module, so it is a good candidate for v5 in my opinion.
NB: This should not be an issue for the JSR-352 implementation (which is deprecated anyway) as there is already an adapter for the item writer: org.springframework.batch.jsr.item.ItemWriterAdapter. This adapter can be updated to adapt a Chunk<T> to a List<Object> as expected by the JSR.
In the spring-batch-integration module, ChunkRequest could also be updated to use Chunk<T> instead of Collection<? extends T> for consistency.
The text was updated successfully, but these errors were encountered:
A chunk of items is a key concept in the chunk-oriented processing model and is nicely modelled with the
org.springframework.batch.core.step.item.Chunk
API. This API is used in almost all interfaces/classes related to the implementation of this model (ieChunkProvider
,ChunkProcessor
, etc) except for theItemWriter<T>
where aList<? extends T>
is used instead. I believeChunk<T>
is a better encapsulation for the chunk of items than aList<? extends T>
:This would make the
ItemWriter
API more coherent and consistent with the rest of the package. This is obviously a breaking change and requires moving theChunk
API to theinfrastructure
module, so it is a good candidate for v5 in my opinion.NB: This should not be an issue for the JSR-352 implementation (which is deprecated anyway) as there is already an adapter for the item writer: org.springframework.batch.jsr.item.ItemWriterAdapter. This adapter can be updated to adapt a
Chunk<T>
to aList<Object>
as expected by the JSR.In the
spring-batch-integration
module,ChunkRequest
could also be updated to useChunk<T>
instead ofCollection<? extends T>
for consistency.The text was updated successfully, but these errors were encountered: