Announcement Announcement Module
Collapse
No announcement yet.
Batching not working with BatchMessageListenerContainer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X