-
1. Re: How to use ref-attribute from apache-camel within SwitchYard
igarashitm May 28, 2014 3:25 AM (in response to mae)1 of 1 people found this helpfulHi Martin,
Can you try adding @Named("myFail") on a Exception class you want to throw?
Thanks,
Tomo
-
2. Re: How to use ref-attribute from apache-camel within SwitchYard
mae May 28, 2014 7:25 AM (in response to igarashitm)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?
-
3. Re: How to use ref-attribute from apache-camel within SwitchYard
igarashitm Jun 2, 2014 10:52 AM (in response to mae)If you put the Exception into camel registry manually, it may be resolved though. I think CDI @Named thing is the easiest way.
-
4. Re: How to use ref-attribute from apache-camel within SwitchYard
mae Jun 3, 2014 8:16 AM (in response to igarashitm)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?
-
5. Re: How to use ref-attribute from apache-camel within SwitchYard
igarashitm Jun 3, 2014 8:38 AM (in response to mae)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.