multiple queue vs single queue - peformance

Hi All,

Could pls throw some light on the following design.

Currenty, We have more than 100 queues and for each there is a different MDB to receive the message.Now, somehow we made a single instance of same MDB listen to all these queues by looking at the input message. The requiement now is, is it possible to club all the queues into single queue as it's asynchronous messaging. The receiver may also try write into the same queue at the end of message processing.If so, how would be performance. Is this performance better than having multiple queues?.

The message are expecting to be 25 k/day in the queue. And we are using Weblogic server.

Please let me know if you need more details.

Thanks

Srinath

[749 byte] By [SrinathDeva] at [2007-11-27 10:40:40]
# 1

That depends on your application. I take it that at the moment you effectively have a some sort of partitioning i.e each queue has a specific MDB and clients publish messages on specific queues. If you were to merge all 100 queues into a single queue you would have to preserve that schema somehow so you MDBs would know which messages to select. If your MDBs don't care which messages they consume then you may be better off with just one queue. Though it's not clear to me why you started off with 100 queues.

Tom

one9966a at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi Tom,

Thanks for the info. More number queues was the initial design of the application. It was few months now i am supporting this application and have added quite a number of queues and MDBs. It seems, these may be increased considerably in the future. So, Instead of addding an entry in xml file and creating an MDB for an addition of queue, thinking of merging the existing queues and MDBs ( only one MDB and this will look at the flag or some parameter set in the input message to indentify the client and call the corresponding implementation class). Taking this approach, not sure how the performance would be impacted. Especially in Weblogic server.

Thanks in advance and pls let me know if you need more details.

SrinathDeva at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

You could try to use selectors to assign messages to particular MDBs. This way you off load some of the work on the broker but selectors by their nature usually have an impact on broker's performance. It all depends on your application, your expectations, size and the rate of your messages, how long it takes to process them on the client side. There is no simple answer in this case. You would have to test some scenarios to come up with a best solution that fits your requirements. Having said that I personally believe that some degree of partitioning of your queue could be beneficial. On a heavily loaded system it may increase the concurrency of the system and its resilience, particularly if you place the queues in different brokers. Try to imagine your broker as if it was a DB server with just one table (I'm not sure if this is the best analogy but I can't think about anything else at the moment).

one9966a at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

I'm doing something simular with one queue and I use mutli threading to handle the processing. Based on flags in the message header you can then pass the message to a waiting thread for that message type/status.

cferris84a at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

How is the performance?. Do you think there would be performace hit if i leave the threading to JMS provider. In the sense, i will have one queue and a pool of same consumers. Consumers decide which message it is by looking the flag set in the message header and call the corresponding implementation class. (Something having like if else condition in MDBs). Thanks in advance

SrinathDeva at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6

Hi Srinathadev,

Could you pls send me sample code to read the XML data from the Queue using MDB and if possible, also the configuration files as well.

Thanks in advance

Hari

svhari76a at 2007-7-28 19:08:07 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...