activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From T Akhayo <t.akh...@gmail.com>
Subject Order in which message is handled by broker plugins?
Date Wed, 20 Mar 2013 15:47:52 GMT
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

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