Reputation: 445
We have multiple Spring Boot web applications that are being triggered by one "parent" application and then run in parallel. For each parallel branch, different applications are called one after the other:
The parent calls A1 and B1 (HTTP requests), which run in parallel. And they in turn then call A2 and B2 whenever A1 and B1 are finished respectively (also HTTP requests).
Now, in case there is an error in A1, we want to broadcast this to all other applications to tell them they need to stop processing:
Canceling the request (if possible) and thus not returning to the caller is fine for us. Our current idea is to simply restart all the services to "reset" them for the next requests.
Are there better approaches? Is there a Spring Boot features that allows to drop/stop/canceln any active requests?
Upvotes: 0
Views: 626
Reputation: 1869
Restarting all the services is bad idea, because your whole solution becomes unavailable for all other "good" requests once you get single "bad" request. I would suggest to implement messaging pattern (on top of RabbitMQ, or even better - Spring Cloud Data Flow). You will be able to better orchestrate the whole pipeline while getting all the Message Queue goodies, like auto discovery/scaling/retry/guaranteed delivery/ect. You will also be able to build the chain and your original question will become obsolete.
Upvotes: 1