activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <>
Subject Re: Order in which message is handled by broker plugins?
Date Wed, 20 Mar 2013 16:17:31 GMT
The plugins array is looped through and installed one at a time. But what
it does is "wrap" the previous broker. So the plugins will see the message
in the reverse order they are specified.

On Wed, Mar 20, 2013 at 8:47 AM, T Akhayo <> wrote:

> Good afternoon,
> I have a activemq server for my jms messages, i've created a custom
> authentication plugin and installed it:
> BrokerService broker = new BrokerService();
> MyAuthenticationPlugin map=new MyAuthenticationPlugin();
> broker.setPlugins(new BrokerPlugin[]{  map});
> Works nicely. Now i want to add a plugin that intercepts messages in the
> send() method of BrokerFilter, this plugin will monitor all messages on all
> topics and write a specific message to a database.
> No problem, just add another plugin:
> BrokerService broker = new BrokerService();
> MyAuthenticationPlugin map=new MyAuthenticationPlugin();
> OrderWatcherPlugin owp=new OrderWatcherPlugin();
> broker.setPlugins(new BrokerPlugin[]{ owp, map});
> Works nicely again. First the MyAuthenticationPlugin handles the message
> next the OrderWatcherPlugin handles the message. When i throw a
> SecurityException in MyAuthenticationPlugin the message is not received by
> OrderWatcherPlugin, as expected.
> I was wondering if the order in which i add plugins is always the order in
> which the message is processed by the plugins?
> What i mean: now MyAuthenticationPlugin gets the message first, next
> OrderWatcherPlugin. Will this always be the case or is it possible that
> OrderWatcherPlugin will receive the message first and next
> MyAuthenticationPlugin?
> Kind regards,
> T. Akhayo

*Christian Posta*
twitter: @christianposta

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message