Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync outbound call using ${camel.sendTo(...)} does not throw exception #25

Open
kiranpatel11 opened this issue Sep 22, 2016 · 0 comments

Comments

@kiranpatel11
Copy link

The camunda-bpm-camel component's camel.sendTo is internally calling producerTemplate.send()

The send() method is not designed to throw the exception to the caller (camunda-bpm-camel component in this case). This makes it impossible to handle the thrown exception in BPM process. e.g. In case of business errors, I would like to throw BpmnError and create UserTask, In cases of technical error, just rethrow the exception so that the execution gets faulted and retried as per the configuration.

Even if I map different exceptions in my route, the camel always makes it available either as Exchange.getException() if i call send() method or CamelExecutionException if I call sendBody() on producerTemplate.

javadoc of the producerTemplate.send(String endpointUri, Exchange exchange)
Sends the exchange to the given endpoint
Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

I think the component needs to change to check the Exchange.getException() and rethow it after calling template.send().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant