-
1. Re: Question about queue, MDBs and threads
adrian.brock Feb 18, 2004 6:20 AM (in response to yxyang)If you have your singleton configured correctly,
there is one server session to deliver messages.
This uses a threadpool of size 1
Regards,
Adrian -
2. Re: Question about queue, MDBs and threads
yxyang Feb 18, 2004 9:10 PM (in response to yxyang)adrain
my question is about the relation between thread, MDB and queue.
First of the first is the definition of "singleton MDB", it is not "singleton Queue". Queue is always FIFO.
Information of a MDB in ejb-jar.xml file includes two parts, one is the queue bound to, the second is the class/code that threads will runn through. In my understanding, "singleton" means that no more than one thread can run on the codes(exactly onMessage()) concurrently. And "singleton" has no relation with the queue. In the other hand, for a queue, it is possible that there are more than one singleton MDBs bound to it (in other words, more than one threads can read messages from the queue concurrently).
Of course, it is possible to force to use one thread to deliever messages for the queue which has a singletonMDB bound to, but this constrains the usage of queue and also decrease the performance. I know the implementation also simple.
Please give comments.
thanks a lot.
yang