Improve performance for MDB

I have created a Message-Driven Bean application to receive message from a MQ. In fact, I anitcipate the application will receive around 10,000 messages a day and it has to do some operations like formatting data and conversion. If it process the message sequentially (one by one). It may take long time to complete. To improve the perf., I am thinking of using mutli-thread to do the operations once message comes in so that the MDB can retrieve another new message as soon as it pass the previous message to the thread for processing with the code snippet shown below:

public void onMessage(javax.jms.Message msg) {

try {

// Suppose t1 is a thread object

t1.process(msg);

}

}

Do you think it is a good approach to process the message efficiently? Do you have any better suggestion to process the messages as fast as possible?

Thanks.

[897 byte] By [joeccha] at [2007-11-27 7:00:20]
# 1

I think the general idea with MDBs is you increase the number of MDBs to increase throughput. The deployment descriptor should have some mechanism for specifying the number of MDBs or listener threads or whatever -- it is an implementation specific configuration.

Dwayne

=========

http://dropboxmq.sourceforge.net/

Myshkin5a at 2007-7-12 18:51:03 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...