camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pkleczka <pklec...@gmail.com>
Subject Re: Change message body after exception
Date Thu, 01 Sep 2011 15:44:10 GMT
Thanks Mick. I need to keep this in Spring XML if possible. It just occurred to me that maybe
it is writing to "in" instead of "out", but I don't know how to change that in the XML. 

On Sep 1, 2011, at 9:37 AM, "BASE Logic, Inc. [via Camel]"<ml-node+4758806-1619861379-223003@n5.nabble.com>
wrote:

> 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 <[hidden email]> 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. 
> > 
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Change-message-body-after-exception-tp4758775p4758806.html
> To unsubscribe from Change message body after exception, click here.


--
View this message in context: http://camel.465427.n5.nabble.com/Change-message-body-after-exception-tp4758775p4758843.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message