You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by agustino <si...@yahoo.com> on 2012/04/30 05:30:48 UTC

useOriginalMessage in recipientList return the wrong message

Hi All,

I am using camel 2.9.2.
I have case like this: route message from file and do transformation, then
do dynamic routing. If some error happened due to invalid destination, I
want to move the original message to error folder.

public void configure() throws Exception {
   
onException(Exception.class).handled(true).maximumRedeliveries(0).useOriginalMessage()
        .to("file://D:/error");
    from("file://D:/inbox").process(new Processor() {
      @Override
      public void process(Exchange exchange) throws Exception {
        //change the message body to "B"
        exchange.getIn().setBody("B");
      }
    }).process(new Processor() {
      @Override
      public void process(Exchange exchange) throws Exception {
        //Try to put some invalid destination
        exchange.getIn().setHeader("path", "file://Z:/inbox");
      }
    }).recipientList(header("path"));
}

I have file (in D:/inbox) contents "A" inside. After throwing the exception,
I check in the error folder, the file contents "B". My expect result is "A".

Is it the correct behavior?

Thanks
Agustino

--
View this message in context: http://camel.465427.n5.nabble.com/useOriginalMessage-in-recipientList-return-the-wrong-message-tp5675017p5675017.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: useOriginalMessage in recipientList return the wrong message

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

No the use original message, should mean the input message, which
would be A in your case.

I cannot reproduce the issue
http://svn.apache.org/viewvc?rev=1341970&view=rev

Since you run windows, then make sure the files and directories is
deleted/empty before running a test etc.



On Mon, Apr 30, 2012 at 5:30 AM, agustino <si...@yahoo.com> wrote:
> Hi All,
>
> I am using camel 2.9.2.
> I have case like this: route message from file and do transformation, then
> do dynamic routing. If some error happened due to invalid destination, I
> want to move the original message to error folder.
>
> public void configure() throws Exception {
>
> onException(Exception.class).handled(true).maximumRedeliveries(0).useOriginalMessage()
>        .to("file://D:/error");
>    from("file://D:/inbox").process(new Processor() {
>      @Override
>      public void process(Exchange exchange) throws Exception {
>        //change the message body to "B"
>        exchange.getIn().setBody("B");
>      }
>    }).process(new Processor() {
>      @Override
>      public void process(Exchange exchange) throws Exception {
>        //Try to put some invalid destination
>        exchange.getIn().setHeader("path", "file://Z:/inbox");
>      }
>    }).recipientList(header("path"));
> }
>
> I have file (in D:/inbox) contents "A" inside. After throwing the exception,
> I check in the error folder, the file contents "B". My expect result is "A".
>
> Is it the correct behavior?
>
> Thanks
> Agustino
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/useOriginalMessage-in-recipientList-return-the-wrong-message-tp5675017p5675017.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: useOriginalMessage in recipientList return the wrong message

Posted by somchaij <to...@abctech-thailand.com>.
See https://issues.apache.org/jira/browse/CAMEL-5378, for explanation and a
link to the unit test of this case,

enjoy,
Tone

--
View this message in context: http://camel.465427.n5.nabble.com/useOriginalMessage-in-recipientList-return-the-wrong-message-tp5675017p5714661.html
Sent from the Camel - Users mailing list archive at Nabble.com.