File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes MDB related question 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 » EJB and other Java EE Technologies
Bookmark "MDB related question" Watch "MDB related question" New topic

MDB related question

Tariq Ahsan
Ranch Hand

Joined: Nov 03, 2003
Posts: 116

I am a newbie in EJB. I have a MDB related question where I have to add some funtionality to an existing application which process a XML input file using the JAXB API. Currently, the input xml file contains with the header information a single record content. The MDB starts with other class methods to parse this XML object. Now, I have to add the funtionality to process a xml file with the header will have multiple records. Wondering if I could parse this new XML input in the format applicable for the existing JAXB generated classes that gets called within the existing MDB's method? Also, like to understand what would be the best way to have some sort of parallel processing of these split XML messages? I guess implementing any sort of multithreading mechanism in EJB could be a no no. Or the MDB itself would take care of this? By the way, I am using JDK 1.3, EJB 2.0.

Thanking you all!
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Generally you don't parse the messages yourself, you use the generated tools for both the MDB client and server. You might want to consider a web service if parsing/handling the messages manually is more desirable since they tend to have easier to read and publicly available definitions. If you want to do parallel processing, for example, read the api's of the tools you are using to figure out how to do so.

Also keep in mind the classic debate between sax and dom parsers in xml. For example, if you want to load the entire file into memory and parse it in parallel, DOM would be the winner, but if the file is too big, you can set multiple sax parsers on it to handle each piece separately.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: MDB related question
It's not a secret anymore!