1 of 1 people found this helpful
Can you try adding @Named("myFail") on a Exception class you want to throw?
Thank you very much.
That works perfectly if i had CDI enabled within my SwitchYard-Application.
But my SwitchYard-Application at the moment is without CDI.
Is there any way to configure this without CDI?
If you put the Exception into camel registry manually, it may be resolved though. I think CDI @Named thing is the easiest way.
Ok finally i got it.
Now my SwitchYard-Application is with CDI.
But "MyException" is now instantiated on deployment-time.
So i have no chance to set a custom-message at runtime (within my xml-route).
Is the <throwException/>-tag not intended to throw an exception with a custom runtime message?
For example i want to make a web-service-call which sometimes responds with an error-message-string.
Is there any way to trow an exception with these error-message-string as exception-message?
I found a feature request for it - https://issues.apache.org/jira/browse/CAMEL-4576 So throwException seems not to have such ability like passing error message. You may want to use Java DSL instead for now.