camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet" <gno...@gmail.com>
Subject Re: Callback on Exchange for closing out streams, result set cursors
Date Tue, 02 Oct 2007 06:49:18 GMT
For streams, one way would be to wrap the stream and do some
processing when the stream is actually closed.  In a general case,
James had introduced the concept of UnitOfWork on the exchange, but
the implementation is not finished.   It seems as if you're looking
for the concept of the done status in JBI.

On 10/2/07, Nicky Sandhu <karajdaar@gmail.com> wrote:
>
> Hi Hiram,
>  You have it right. I want to close it when the exchange completes. Is there
> a way to signal this? a callback perhaps?
>  For example in a producer is process(Exchange ex) method: to be able to
> either commit or rollback depending upon whether the exchange exception is
> null or not after the routing rules for that exchange have been processed.
>
>
> Hiram Chirino wrote:
> >
> > Hi Nicky,
> >
> > In your use case, it looks like you want to write a processor that
> > attaches a resource to the exchange that should not be closed by the
> > time the process() call finishes.. It should get closed when the
> > exchange completes.  Is this correct?
> >
> > Regards,
> > Hiram
> >
> > On 10/1/07, Nicky Sandhu <karajdaar@gmail.com> wrote:
> >>
> >> Hi folks,
> >>  I see a number of commits based on async callback discussion
> >> (http://www.nabble.com/Asynchronous-Exchange-Processing-t4313758s22882.html).
> >> I am wondering if it applies to this usecase as well.
> >>  For stream oriented or cursor oriented message bodies it is necessary to
> >> have a callback so that cleanup such as closing out the
> >> stream/resource/cursor can be done...else there would be leaks.
> >>  So if a process does something like
> >>  process(new Processor(){...
> >>     ResourceStream stream;
> >>     process(Exchange ex){
> >>       setBody(stream = new ResourceStream());
> >>       .....
> >>     }
> >>     onComplete(){
> >>        closeStream();
> >>     }
> >>     onFailure(){
> >>        closeStream();
> >>     }
> >> });
> >>
> >>   Any chance this kinda support is going to be able to make it to 1.2
> >> release ?
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Callback-on-Exchange-for-closing-out-streams%2C-result-set-cursors-tf4549498s22882.html#a12982891
> >> Sent from the Camel - Development mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Regards,
> > Hiram
> >
> > Blog: http://hiramchirino.com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Callback-on-Exchange-for-closing-out-streams%2C-result-set-cursors-tf4549498s22882.html#a12992505
> Sent from the Camel - Development mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Mime
View raw message