Today we have a web app and a legacy API exposing some of REST endpoints to get booking of client. The booking are fetched with a SOAP operation, and the returned response for a specific type of booking differs from the other types. Moreover, these calls are latent and cause a long wait, especially when a client has more than 5 bookings. The next diagram shows a simple interaction between components:
The idea of this project is to copy the existent data (clients and booking) in a new schema and get a copy of soap response for each client and booking. The next diagram shows a simple interaction between components with spring batch:
My goal is to use Spring batch to:
copy client an booking tables
use the couple booking type/references for each client to call SOPA operations
persist the result in new booking information table
clients = clientRepository.findBy(id) foreach client in clients bookings = bookingRepository.findBy(id) foreach booking in bookings call soap with (booking.reference, booking.type) map newBooking persist newBooking with client.id, booking.reference
I am new to Spring and I don't know how to do these operations with parameterized query in a repository class and nested with SOAP calls.