We have to make a bunch of HTTP calls from Java/Spring-Boot application which will be mix of in-sequence and parallel.
Level 1 : We make 3 parallel calls to Services 1 , 2 and 3
Level 2: After service 1 response is received (which is a list), we make parallel calls to service 4 and 5 for each item in list
Level 3 : After service 5 response is received, depending on its response, we make parallel calls to Service 6 for few of items received from service 1.
Which design pattern should be used? Will the Command design pattern would be a good use case here?
I was thinking, may be we create a DataProvider
having 2 properties isParallel
and httpService
.
And then I ccreate objects of DataProvider
and set these 2 attributes for each of the HTTP call we want to make. Does it make sense?
pipeline
to me.