camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick Knutson <mknut...@baselogic.com>
Subject Re: Change message body after exception
Date Thu, 01 Sep 2011 15:35:41 GMT
I cant read the code you added, but I use the setHeader and setBody in java


.setHeader(Routes.FUNCTIONAL_AREA_HEADER).method(CallEventHeaderService.class,
"getFunctionalArea")

this way I use a bean to set the fields like:

public String getFunctionalArea(CallEvent callEvent) {
        return callEvent.getFunctionalArea().name();
    }


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Thu, Sep 1, 2011 at 11:27 AM, pkleczka <pkleczka@gmail.com> wrote:

>  Hi
>
> I am trying to enhance the message body after an exception. It does route
> to
> the correct place, but the message is not altered. (The "simple" element
> below actually contains entity codes for left and right angle brackets, but
> shows up in this post as angle brackets).
>
>       <route id="EFilEBatchRequestTransform">
>            <from
> uri="properties:{{queue.efilebatch.request.validatedtracsxsd}}" />
>                            <to
> uri="properties:{{transformer.efilebatch.stripPrdKeyElement}}"/>
>                        <to
> uri="properties:{{transformer.efilebatch.addCountNumber}}"/>
>                        <to
> uri="properties:{{transformer.efilebatch.changeOffenseCodeValue}}"/>
>                        <to
> uri="properties:{{transformer.efilebatch.changeLocationNodeIDValue}}"/>
>                        <to
> uri="properties:{{transformer.efilebatch.codeTranslation}}"/>
>                        <to
> uri="properties:{{transformer.efilebatch.replaceSchemaLocation}}"/>
>                        <to
> uri="properties:{{queue.efilebatch.request.transformed}}"/>
>
>
>                            <onException useOriginalMessage="false" >
>
> <exception>org.xml.sax.SAXParseException</exception>
>
> <exception>org.apache.camel.ValidationException</exception>
>
> <exception>java.lang.RuntimeException</exception>
>                           <handled><constant>true</constant></handled>
>
>                                   <setBody>
>                                     <simple>
>
>
> &lt;ReceiptList&gt;&lt;Batch&gt;&lt;JMSMessageID&gt;${header.JMSCorrelationID}&lt;/JMSMessageID&gt;&lt;Exception&gt;${exception}
> - CAUSE-IS:
>
> ${exception.cause}&lt;/Exception&gt;&lt;CamelRoute&gt;EFileBatchBusinessRulesRequestCheck&lt;/CamelRoute&gt;&lt;MessageBody&gt;&lt;![CDATA[${in.body}]]&gt;&lt;/MessageBody&gt;&lt;Result&gt;Fail&lt;/Result&gt;&lt;/Batch&gt;&lt;/ReceiptList&gt;
>                                     </simple>
>                                   </setBody>
>
>                       <to
> uri="properties:{{queue.efilebatch.request.rejected}}" />
>                               <to
> uri="properties:{{queue.efilebatch.response}}" />
>
>                            </onException>
>
>        </route>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Change-message-body-after-exception-tp4758775p4758775.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message