Am setting up a project where bulk commit of JMS has to be done in a single shot. Using the transaction for restarting the message processing, so need thoughts on how to push "x" number of messages onto a JMS Queue and do JMS commit.
What am currently doing is creating a JMS message which a long string appended with the message which I wish to commit in one shot. Then use a Splitter to split the message into multiple in another route. Finally, use another route to send the messages onto JMS (as a bulk commit).
<route>
<from uri="file:sample"/>
<split streaming="true">
<tokenize token="\n"/>
<to uri="activemq:queue:dest"/>
</split>
</route>
I wish to construct a route that controls when the JMS commit is issued.
The use case is am trying to read a message from Queue A and create many messages (let that number be "x"). And push them to Queue B. However, I wish to do a bulk commit (or batch commit) like DB. Am trying to be efficient not to create connections to JMS and do individual commits.