In a spring boot app, I use spring batch. I have two datasource.
For the reader, I use JpaPagingItemReader
My batch config class
@Configuratoin