activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: How to "activate" an interceptor
Date Mon, 23 Nov 2009 17:07:25 GMT
On Mon, Nov 23, 2009 at 8:48 AM, moreno9000 <> wrote:
> Yes,
> when a procuder calls send() method, I'd like to intercept
> the request, verify number of messages in destination queue,
> throw an exception if number of msg, after this last send(),
> exceed a predefined limit.

Does this mean that you're going to discard new messages that are sent
to the queue if a predefined number of messages already exists? Seems
like an odd use case. What exactly are you trying to achieve? Please
describe the business use case, not the code use case.

You'll need to continually grab the current message count using the
ActiveMQ JMX API and use that to track message counts. Just be aware
that there's a lot of asynchronous behavior that takes place inside
the broker. This asynchronous behavior can affect an accurate message
count from one moment to the next, but this is the best way.

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message