On Wed, Feb 13, 2013 at 3:21 PM, Marek Pszczolka <mpszczo...@gmail.com> wrote:
> Why ExchangeHelper.copyResults(Exchange, Exchange) method doesn't copy
> exchange pattern from the source exchange? By default it is InOnly.
>

Because it copies the result which is the body + headers etc.


> The following junit fails:
>
>             Exchange source = new DefaultExchange(context, 
> ExchangePattern.InOut);
>             source.getIn().setBody("source body");
>
>             Exchange copy = new DefaultExchange(context, 
> ExchangePattern.InOnly);
>             copy.getIn().setBody("copy body");
>
>             ExchangeHelper.copyResults(copy, source);
>
>             assertTrue(copy.getIn().getBody().equals("source body"));
>             assertTrue(copy.getPattern().equals(ExchangePattern.InOut));   //
> fails! pattern is still InOnly
>
> Old copying method: "ex.copyFrom(exchange);"  copied also exchange pattern
> to from exchange.
>
> I'm using Camel 2.7.2, but I don't see any changes in 2.9.0 in that area.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to