users@glassfish.java.net

Re: Re: What decides when to process messages with MDB

From: <steff_at_designware.dk>
Date: Thu, 16 Jun 2011 10:12:07 +0000 (GMT)

We are not using Glassfish MQ, so I dont know if we will experience the
same with that. Are you thinking about OpenMQ when you talk about
Glassfish MQ?

What does the resource adaptor need threads (and therefore a thread
pool) for, if it is not for running the handling of messages in MDB's.

I believe there are a difference between bean-pools and thread-pools.
Basically you need to get a thread (from the thread pool) and a
bean-instance (from the bean-pool) to be able to process a message. I
believe they are kind of two separate ways of controlling how much can
run in parallel. Imagine that you have a bean-pool of size 10 for MDB A
and a bean-pool of size 10 for MDB B, and that they are sharing a
thread-pool of size 10. You will have achieved that you can never
handle more than 10 A-messages concurrently, that you can never handle
more than 10 B-messages concurrently, AND that you can never handle
more than 10 A-and/or-B messages concurrently. E.g. if there are 10
A-messages ready to be handled and 10 B-messages ready to be handled,
you will not get them all handled concurrently (due to the thread-pool
size), you might get 5 of each handled concurrently or maybe 8
A-messages and 2 B-messages.

This is just the way I imagine that it works, and the way I know it
works in other JEE app servers (at least in one other JEE app server I
know very well :-) ), but please tell me different if you know that I
am not correct.

So I dont believe you control thread-pool size by <bean-pool> settings
in sun-ejb-jar.xml. MDB messages handling might use the default
thread-pool, but then I cannot se why you are assigning a thread-pool
to the resource adapter - the resource adapter that you in
sun-ejb-jar.xml assign to the MDBs. But again please enlighten me you
you KNOW that I am wrong.

Regards, Per Steffensen