camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pratibhaG <pratibha.ghog...@in2m.com>
Subject RE: How to handle different types of errors?
Date Fri, 23 May 2008 10:42:47 GMT

I want to tap message from these two routes for different Exception types:
1) jbi:endpoint:http://test/MyService/endpoint -->
jbi:endpoint:http://test/MyProviderServicePortal/providerEndpointPortal
2) jbi:endpoint:http://test/MyService/endpoint
-->jbi:endpoint:http://test/MyProviderService/providerEndpoint

there can be many types of exceptions like NullPointerException,
ConnectionException or my custom exceptions on both the routes how can I
handle the situation?

I tried this
exception(java.net.ConnectionException.class).maximumRedeliveries(4).to("jbi:endpoint:http://test/errorStorageService/errorStorageEndpoint");
      
from("jbi:endpoint:http://test/MyService/endpoint").to("jbi:endpoint:http://test/MyProviderService/providerEndpoint");
It works fine. that is when a message flows from
jbi:endpoint:http://test/MyService/endpoint to
jbi:endpoint:http://test/MyProviderService/providerEndpoint if
ConnectionException arises then it is sent to
jbi:endpoint:http://test/errorStorageService/errorStorageEndpoint after 4
times retrial.

But on this path there can be other exceptions and I want to take different
action based on the exception type.

please help
-Pratibha
-- 
View this message in context: http://www.nabble.com/RE%3A-How-to-handle-different-types-of-errors--tp17420074s22882p17423142.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message