error handling - Camel ErrorHandler useOriginalMessage Attribute -


I'm using Camel (current version 2.12.2) for a little more than a year and an interesting one To overcome this issue with the situation (some hundred passages) of one of the web applications, I want to use a special error handler which returns an exception to the specific enhanced routes, then returns to the original body. Here is a small sample reference that I have put together to explain what I want to do:

  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Bem xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: camel = "http: // Camel Apache.org/schema/spring "xmlns: reference =" http://www.springframework.org/schema/context "xmlns: util =" http://www.springframework.org/schema/util "xsi: schema location = "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http: / /www.springframework.org/schema/context/spring-context-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring .xsd Http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> & Lt ;! - Use for rich routes so that they can pass the original to the global on an exception while coming up with the exception - & gt; & Lt; Camel: errorHandler id = 'Promotion Earhardlet' type = "DefaultErrorHandler" Use original message = "true" /> & Lt; Camel: Endpoint Camel ContexID = "TestAirHarrier Contact" ID = "Test SurroundindPoint" Yuri = "Servlet: /// Order" /> & Lt; Bean id = "testx" class = "java.io.IOException" /> & Lt; CamelContext id = "TestErrorHandlerContext" xmlns = "http://camel.apache.org/schema/spring" xmlns: oas = "http://www.verizonwireless.com/oas" trace = "true" & gt; & Lt; OnException & gt; & Lt; Exceptions & gt; Java.io.IOException & lt; / Exceptions & gt; & Lt; Handled & gt; & Lt; Continuous & gt; True & lt; / Continuous & gt; & Lt; / Handled & gt; & Lt; Log message = "logging" /> & Lt; / OnException & gt; & Lt; Route id = "startroute" & gt; & Lt; Yuri = "test circle idpoint" /> & Lt; Options & gt; & Lt; When & gt; & Lt; Simple & gt; $ {Body} == 'Hello' & lt; / Simple & gt; & Lt; SetBody & gt; & Lt; Continuous & gt; World & lt; / Continuous & gt; & Lt; / SetBody & gt; & Lt ;! - Use new body - & gt; & Lt; ThrowException ref = "testEx" /> & Lt; / When & gt; & Lt; Otherwise & gt; & Lt; Rich uri = "direct: rich path" /> & Lt; / Otherwise & gt; & Lt; / Options & gt; & Lt; / Route & gt; & Lt; Route ID = "Rich Route" error handlerRF = "prosperous airhader" & gt; & Lt; From Yuri = "Direct: Rich Route" /> & Lt; SetBody & gt; & Lt; Continuous & gt; SomethingElse & lt; / Continuous & gt; & Lt; / SetBody & gt; & Lt ;! - Use the original body - & gt; & Lt; ThrowException ref = "testEx" /> & Lt; / Route & gt; & Lt; / CamelContext & gt; & Lt; / Bean & gt;  

When I send 'Hello', I get back 'world' -> hope

When I send 'something', then I 'SometingElse' -> unexpected

My thought process tells me that the rich path should use the original body because this prosperity refers to the eagerhardler. What's wrong with my expectation?

I know that to return to the original level, I can get the pathway on the expansion block, but if I can handle error handler references, about 40 or so of the route definitions Must have changed.

I came to the conclusion that a path-level reservation section or a rich on a Dotri / Douchach Back is the only way to settle exceptions.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -