This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Bulk XML messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Bulk XML messages" Watch "Bulk XML messages" New topic

Bulk XML messages

Uma Reddy

Joined: Apr 16, 2010
Posts: 4
I need design advice on how to bulk smaller XML messages into one big XML message. Basically, we have XML messages that are getting posted to a JMS Topic. When we have 500 messages in the JMS topic, we want to bulk these 500 messages into one big XML message and make one database call(batch update) instead of 500 calls. What are the best ways of doing this. Also, are there other ideas of achieving the same thing. Thanks in advance.
Ahmet Tapmaz

Joined: Mar 02, 2011
Posts: 4
which parser are you using ? Dom parser , sax parser or another one
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Sounds like you want to build the text of a new document with a root that contains all the little documents.

I would certainly treat this as a pure text manipulation problem - exactly how depends on the content of the small messages. Do they start with a declaration like:

if so you will need to trim that text - having one inside the big document will cause an error.

Uma Reddy

Joined: Apr 16, 2010
Posts: 4
Thanks for the responses. We are using sax parser
I agree. Here's the link:
subject: Bulk XML messages
It's not a secret anymore!