activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Attila_Szegedi <>
Subject Re: Message prioritization
Date Thu, 04 May 2006 07:48:41 GMT

In our use case, we're doing bulk processing most of the time, so the vast
majority of the messages are normal priority. Every now and then though, we
have a situation where we're processing for an interactive user (imagine a
consumer at the end of a user interface waiting for our automated backend to
respond, connecting to us as a result of a notification sent to him from a
bulk work unit, needing user interaction to proceed). We need to make sure
that the messages that belong to this realtime interaction with the user are
expedited, for obvious consumer experience reasons. In such a situation,
your suggestion is unfortunately suboptimal, as you implied that the ratio
of high to low priority messages is higher than it is for us.

Now, keeping a separate queue might work. Although I can imagine - JMS spec
is fuzzy on this - that if I have a single connection with pool of sessions
with message listeners installed in each one for both the queue named "NORM"
and "HIGH" then the JMS broker will still dispatch to them in aggregate FIFO
order of all queues that the connection has consumers for, so that again
defeats the purpose. I'm not saying this holds for ActiveMQ - I have no idea
at this point, I'm just trying to avoid developing a solution that'll be
affected by the broker implementation.

Of course, I could always keep up a second connection with only few sessions
consuming the high priority queue exclusively. With two connections, they're
handled as two distinct clients by the broker, so they're independent of one
another. This only leaves the problem of those few session threads competing
for CPU with the lot more threads running the normal priority message
listeners, but that's probably insignificant and only the pedantic in me is
bothered by it. 

It is however quite tedious to implement such a two-lane queuing system
across the whole distributed system, which has a rather nontrivial number of
interacting JVMs communicating over quite a lot of queues. It'd be *much*
more simple to have JMS handle all of this for me if I set a priority on a
message - that's what frameworks and middlewares are for, right? To take
away and contain complexity from the stuff I have to write :-)
View this message in context:
Sent from the ActiveMQ - User forum at

View raw message