Hi Flo, The completion of the batch value has a higher priortity than the timeout. Therefore the batch should always complete the expected number. The timeout is meant to keep the consumer from starving. Say you have a batch of 100 and only 50 msgs are produced. We don't want the transaction being held open forever. It was not meant to protect you from bad messages. That is what an error handler is for.
Make sense? Thanks, ses On Fri, Oct 11, 2013 at 3:06 AM, flovansi <florent.vansilie...@swift.com>wrote: > Thank you for your answer. > > I do not have any unit tests right now but I'll try to do some. > > Another thing that is strange in the implementation of the timeout. > > The timeout is set in the resetTask() method which is called at the > completion of the exchange (SessionBatchTransactionSynchronization.java). > If > I'm understanding it well, the timeout seems to be reset at each exchange > completion. That is not really the definition of a timeout. So, if the > first > exchange of the batch enters in an infinite loop, the completion will never > be executed and the timeout will not be triggered. > > Plus, the timeout task is not canceled in case of failure (onFailure > method). > > Please correct me if I am wrong, > > Florent > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/SJMS-implementation-Batch-Consumer-tp5741291p5741323.html > Sent from the Camel Development mailing list archive at Nabble.com. > -- -- Scott England-Sullivan Apache Camel Committer Principal Consultant / Sr. Architect | Red Hat, Inc. FuseSource is now part of Red Hat Web: fusesource.com <http://www.fusesource.com> | redhat.com<http://www.redhat.com> Blog: sully6768.blogspot.com Twitter: sully6768