You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Santhosh <kk...@gmail.com> on 2016/10/25 18:37:28 UTC

OnException across camelcontext not called when using direct-vm

I have multiple context, and I use direct-vm to call route in another
context. If there any exception, direct-vm is not passing that exception
correctly to the parent/source route. If I use nmr, then source route gets
the exception and onException is getting called correctly.

Here in this example

 <camelContext id="context1" trace="true"
xmlns="http://camel.apache.org/schema/spring">
            
        <onException>
            <exception>java.lang.Throwable</exception>
            <handled>
                <camel:constant>true</camel:constant>
            </handled>   
            <to uri="bean:exceptionProcessor" />
        </onException>
        
        
        <route id="context1route">
             <from uri="cxfrs:bean:serviceEndpoint"/> 
			<to uri="direct-vm:route2"/>  
		</route>
</camelContext >

<camelContext id="context2" trace="true"
xmlns="http://camel.apache.org/schema/spring">
        
        
        <route id="context1route">
             <from uri="direct-vm:route2"/> 
			<to uri="bean:someProcessor"/>  
		</route>
</camelContext >



--
View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OnException across camelcontext not called when using direct-vm

Posted by Santhosh <kk...@gmail.com>.
Thanks for your help. 

Sent from my iPhone

> On Oct 26, 2016, at 4:04 PM, Santhosh [via Camel] <ml...@n5.nabble.com> wrote:
> 
> Ok That solves the problem. 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237p5789309.html
> To unsubscribe from OnException across camelcontext not called when using direct-vm, click here.
> NAML




--
View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237p5789310.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OnException across camelcontext not called when using direct-vm

Posted by Santhosh <kk...@gmail.com>.
Ok That solves the problem.



--
View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237p5789309.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OnException across camelcontext not called when using direct-vm

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I see there isn’t any exception handling in context2, but the default error handler is still there - have you tried setting the error handler on the context to “No Error Handler”? (http://camel.apache.org/error-handler.html <http://camel.apache.org/error-handler.html>)

> On Oct 25, 2016, at 7:32 PM, Santhosh <kk...@gmail.com> wrote:
> 
> There is no exception handling in route2, it just throws the exception. I see
> exception in the log, thrown by route2. But context1 never get those
> exception.
> 
> If I use nmr route, then everything works fine.
> 
> Thanks
> Santhosh
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237p5789247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnException across camelcontext not called when using direct-vm

Posted by Santhosh <kk...@gmail.com>.
There is no exception handling in route2, it just throws the exception. I see
exception in the log, thrown by route2. But context1 never get those
exception.

If I use nmr route, then everything works fine.

Thanks
Santhosh



--
View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237p5789247.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OnException across camelcontext not called when using direct-vm

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Have you tried disabling error handling on context2?



> On Oct 25, 2016, at 12:37 PM, Santhosh <kk...@gmail.com> wrote:
> 
> I have multiple context, and I use direct-vm to call route in another
> context. If there any exception, direct-vm is not passing that exception
> correctly to the parent/source route. If I use nmr, then source route gets
> the exception and onException is getting called correctly.
> 
> Here in this example
> 
> <camelContext id="context1" trace="true"
> xmlns="http://camel.apache.org/schema/spring">
> 
>        <onException>
>            <exception>java.lang.Throwable</exception>
>            <handled>
>                <camel:constant>true</camel:constant>
>            </handled>   
>            <to uri="bean:exceptionProcessor" />
>        </onException>
> 
> 
>        <route id="context1route">
>             <from uri="cxfrs:bean:serviceEndpoint"/> 
> 			<to uri="direct-vm:route2"/>  
> 		</route>
> </camelContext >
> 
> <camelContext id="context2" trace="true"
> xmlns="http://camel.apache.org/schema/spring">
> 
> 
>        <route id="context1route">
>             <from uri="direct-vm:route2"/> 
> 			<to uri="bean:someProcessor"/>  
> 		</route>
> </camelContext >
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/OnException-across-camelcontext-not-called-when-using-direct-vm-tp5789237.html
> Sent from the Camel - Users mailing list archive at Nabble.com.