activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: How to "activate" an interceptor
Date Mon, 23 Nov 2009 14:52:12 GMT
On Mon, Nov 23, 2009 at 7:15 AM, moreno9000 <moreno.mauri@italtel.it> wrote:
>
> Hi,
> I'd like to write an interceptor that controls the size of a queue
> (number of messages in the queue) and throws an exception
> if the queue has reached a predefined limit.
>
> I wrote two classes.
> The first one (ItlPlugin class) implements BrokerPlugin.
> The second one (ItlBroker class) extends BrokerFilter.
> In AMQ XML conf file I declare to use ItlPLugin.
>
> Everything is ok (plugin is installed during AMQ startup),
> but now I don't know how to "activate" the interceptor
> (probably, I haven't understood interceptor's logic :-().
>
> Do I need to override one of BrokerFilter's methods
> in order to control queue size and throws the exception?
>
> This method is "automatically" called when a message
> is sent to AMQ or a client (producer) has to explicitly
> call it?

You already registered your BrokerPlugin via the ActiveMQ XML config
and that's all you need to do. Your ItlBroker should override methods
in the BrokerFliter so that the ActiveMQ broker will invoke those
methods automatically.

Bruce
-- 
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: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Mime
View raw message