I am trying to use and understand Java8 CompletableFuture concept. Please help me to under if there is a way I can implement by below scenario.
Scenario Description: I have a Car repository and a user repository.
I have individual service like: getUserData (returns List) and getCarData (returns List) to fetch me the values.
Now I have created another repository called: CarBooking and it has a service called createNewBooking, which should accept List and List as input.
Is there any way that I can create a chained method using CompletableFuture which can combine these services/tasks to be triggered.
Like CompletableFuture.supplyAsync(this::getUserData).....
I am not able to understand how can I join another service and use first and second value to third service as BiConsumer.
Help is much appreciated.