1

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:

legacy app

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:

new app

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.

1 Answer 1

0

One option to implement the pseudo code of your solution in Spring Batch is to create a chunk-oriented step defined as follows:

  • The item reader reads client IDs
  • An item processor fetches bookings for each client
  • The item writer writes data to both tables

This pattern has a name, the "driving query pattern", which is documented here: Common Batch Patterns -> Driving Query Based ItemReaders.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.