You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Nicky Sandhu <ka...@gmail.com> on 2007/10/11 20:57:30 UTC

Pipeline createNewExchange

Pipeline createNewExchange method copies the previous exchange and sets the
previous Out to current In. However it leaves the current Out to previous
Out ??

I fixed this by these two lines
        answer.getOut().setBody(null);
        answer.getOut().setHeaders(null);

However the PipelineTest assert fails... incorrect assertion IMHO of the
result from a template send coming back with the out populated... only the
mock:result should have the out populated and that assertion of the tests
still stands

Could someone take a look and opine?

Nicky
-- 
View this message in context: http://www.nabble.com/Pipeline-createNewExchange-tf4609319s22882.html#a13162515
Sent from the Camel - Development mailing list archive at Nabble.com.


Re: Pipeline createNewExchange

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Me wishes the pipeline did not copy exchanges at all..
Just to clarify, the pipeline copies the exchanges to handle mixing
components that use different exchange types in the same route?  Or is
there another reason?

On 10/16/07, James Strachan <ja...@gmail.com> wrote:
> On 11/10/2007, Nicky Sandhu <ka...@gmail.com> wrote:
> >
> > Pipeline createNewExchange method copies the previous exchange and sets the
> > previous Out to current In. However it leaves the current Out to previous
> > Out ??
> >
> > I fixed this by these two lines
> >         answer.getOut().setBody(null);
> >         answer.getOut().setHeaders(null);
> >
> > However the PipelineTest assert fails... incorrect assertion IMHO of the
> > result from a template send coming back with the out populated... only the
> > mock:result should have the out populated and that assertion of the tests
> > still stands
> >
> > Could someone take a look and opine?
>
> Great catch Nicky!
>
> I've patched the Pipeline to work a bit nicer; rather than copying the
> entire exchange/in/out then nullifying things, we now just create an
> empty exchange, then copy the IN from the previous OUT or IN. I found
> a few test cases failing as a result (and patched the Exchange
> implementations so that they can be created from a parent exchange to
> copy in the unitOfWork stuff).
>
> But it all seems to be hanging together nicely now.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: Pipeline createNewExchange

Posted by James Strachan <ja...@gmail.com>.
On 11/10/2007, Nicky Sandhu <ka...@gmail.com> wrote:
>
> Pipeline createNewExchange method copies the previous exchange and sets the
> previous Out to current In. However it leaves the current Out to previous
> Out ??
>
> I fixed this by these two lines
>         answer.getOut().setBody(null);
>         answer.getOut().setHeaders(null);
>
> However the PipelineTest assert fails... incorrect assertion IMHO of the
> result from a template send coming back with the out populated... only the
> mock:result should have the out populated and that assertion of the tests
> still stands
>
> Could someone take a look and opine?

Great catch Nicky!

I've patched the Pipeline to work a bit nicer; rather than copying the
entire exchange/in/out then nullifying things, we now just create an
empty exchange, then copy the IN from the previous OUT or IN. I found
a few test cases failing as a result (and patched the Exchange
implementations so that they can be created from a parent exchange to
copy in the unitOfWork stuff).

But it all seems to be hanging together nicely now.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com