[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to properly pass/handle Exceptions with an Async Camel Rest Application

Hello all!

I am currently working on an async Camel Rest application with several components.

1.) I have a "Request handler" that is responsible for all user-Rest requests. It accepts a get input and responds with a redirect url.
2.) The input is processed, splited, aggregated, etc. in the according components/routes.
3.) When the processing is finished, the user can get the result at the request-url he received from the request handler. Providing the result is also done by  the request handler.

User --(input)--> RequestService -> [Processing] -> StoreResults
User --(getResults) --> RequestService -> return stored Results to User if finished

So now it could happen that one processor throws an exception for whatever reason. How can I immediately pass this exception to the request handler to let the User know his input was invalid and cancel the whole processing operation? Is there a common way to do it, or some kind of best practice?

Best Regards