Results 1 to 2 of 2

Thread: Batching not working with BatchMessageListenerContainer

  1. #1
    Join Date
    Jan 2008
    Posts
    23

    Question Batching not working with BatchMessageListenerContainer

    Hi,
    I'm facing a problem with batching in the BatchMessageListenerContainer. I pass to it a repeatTemplate with

    Code:
                rt.setCompletionPolicy(new SimpleCompletionPolicy(5));
    But while processing the messages, it does so one per transaction rather than
    processing 5 messages in the same transaction as per completion policy.

    On some debugging, I noticed that doBatchCallBack() calls the super.receiveAndExecute() which is in AbstractPollingMessageListenerContainer

    In this method, the transaction is explicitly being committed every time, if executed successfully. There is no hook that can be used to tell it to do a commit/rollback conditionally.

    Am I missing something here or is this an issue? Please help!!

    Thanks,
    Abhi

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    How is your transaction boundary set up? Did you declare a transaction around your RepeatTemplate.iterate() method? You have to read the comments in the code to know that this is necessary, but it is (as I said before) work in progress.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •