Message selector induced single-threaded behavior

Hi,

We are using Sun MQ 3.6 enterprise edition on Linux x-86. We have the following set up:

1. A stand-alone JMS server, with queues and topics where one of the queue is, say, TaskQueue

2. A stand-alone Java application as producer that pumps task messages onto TaskQueue

3. The messages on TaskQueue have simple properties set on them, like type=10, type=20, etc

4. Multiple stand-alone Java application task runners, each configured with 5 threads. Each thread has one consumer that has its own session, but shares one public connection in the JVM. Each consumers take messages off of TaskQueue to execute some business logic. The business logic takes anywhere from 30 seconds to a few minutes to run thru.

All is fine if the consumers (may be as much as 50 when we have 10 runners with 5 threads each) do not use message selectors. By "fine" I mean we see each thread in each runner actively consuming messages from TaskQueue. However, if we just turn on a simple message selection, like type=10 on some runners and type=20 on others, we would see single-threaded behavior. That is, each runner will now only have one thread actively consuming messages with all other threads alive but sitting idle as we are using blocking receive() API. Turning on message selection is based on setting a flag in a property file.

Can anyone suggest what we should be looking to resolve this behavior?

Thanks.

--albert

[1466 byte] By [hayu101] at [2007-11-26 6:17:58]
# 1

We are using SMQ 3.5SP2 and have a setup of durable subscribers very similar to your setup. I don't see the single threaded behaviour that you are talking about and we are also using the blocking receiver call.

For example we have:

1) a single Topic - containing messages with jms properties set on them (for selector use)

2) hundreds of durable subscribers each with its own selector and session - all running in the same process connected to the same topic.

3) We are using the blocking receive method in each consumer (for synchronous consumers) that are running in their own thread

As far as I'm aware the other threads/subscribers using selectors are consuming fine even when one consumer is blocked waiting for data.

Of course, this is version 3.5SP2 and not 3.6 which we have not tested against.

jbeech at 2007-7-6 13:59:56 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 2
And we're on Solaris whereas you are on Linux - so that might be the issue for you.
jbeech at 2007-7-6 13:59:56 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 3

albert,

I wrote a test case to simulate what you described and verified that this is a MQ bug. Messages are not evenly distributed to the round robin queue receivers if selectors are used.

The algorithm used by MQ to distribute messages to round robin queue receivers needs to be improved.

I filed a bug report to imporve the current behavior (bug ID 6413182).

Thanks.

chiaming

chiamingyang at 2007-7-6 13:59:56 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...