camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens <smix...@dzbank.de>
Subject Re: Does onException not support multiple statements?
Date Thu, 12 May 2011 13:31:16 GMT
> Doesn't from("....").handleFault() work either?

Building on my previous example I'm assuming it should look like this?

			public void configure() throws Exception {
				Endpoint ep = context.getEndpoint("cxf:bean:serviceEp");
				Processor proc1, proc2;
				
				proc1 = applicationContext.getBean("proc1", Processor.class);
				proc2 = applicationContext.getBean("proc2", Processor.class);
				
				onException(java.lang.Exception.class).
					handled(true).
					process(proc1).
					process(proc2).
					to("mock:fault2");
				
				from("direct:startJava").
					setHeader("operationName", constant("greetMe")).
					to(ep).
					handleFault();
			}

If so then no, that doesn't work, either.

>>> Jens, I think you can use this interceptor to convert faults to
>>> exceptions...see
>>> https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
>>> this unit test
>>>
>>> basically, just add this to your context...
>>>
>>> getContext().addInterceptStrategy(new HandleFault());
>>
>> Thanks for that. Unfortunately that doesn't seem to help much. In fact, I
>> don't see the interceptor firing at all. Is there anything else that
>> needs
>> to be done to enable an InterceptorStrategy? 

--
View this message in context: http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4390239.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message