// Since camel doesn't support onException closures together with doCatch/doFinal
// code below is commented because it doesn't work as expected
// definition.onException(Throwable.class).processRef(FATAL_ERROR.name());
TryDefinition tryDefinition = definition.doTry();
addThrottling(tryDefinition);
tryDefinition
.processRef(CONSUMER_INTERCEPT.name())
.processRef(ADDRESSING.name())
.processRef(TRANSACTION_HANDLER.name())
.processRef(SECURITY_PROCESS.name())
.processRef(GENERIC_POLICY.name())
.processRef(VALIDATION.name())
.processRef(TRANSFORMATION.name())
.processRef(VALIDATION.name())
.processRef(PROVIDER_INTERCEPT.name())
.processRef(PROVIDER_CALLBACK.name())
.processRef(PROVIDER_INTERCEPT.name())
.processRef(SECURITY_CLEANUP.name())
.processRef(TRANSACTION_HANDLER.name())
.addOutput(createFilterDefinition());
tryDefinition
.doCatch(Exception.class)
.processRef(ERROR_HANDLING.name())
.processRef(PROVIDER_INTERCEPT.name())
.processRef(SECURITY_CLEANUP.name())
.processRef(TRANSACTION_HANDLER.name())
.addOutput(createFilterDefinition());
tryDefinition.doFinally()
.processRef(CONSUMER_INTERCEPT.name())
.processRef(CONSUMER_CALLBACK.name());
}