Reputation: 197
I want to read data from an api endpoint using spring-batch .Is it possible for me to read the data in a paginated way. Example :-
Upvotes: 4
Views: 5977
Reputation: 31600
Since your API already provides pagination, you can create a reader that extends AbstractPagingItemReader
and implement the doReadPage
method where you call the API to request a page of items (with a configurable size). If the endpoint is a REST endpoint, the reader can use a RestTemplate
to make the call.
Upvotes: 6