Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D8DD7F574 for ; Wed, 20 Mar 2013 17:41:33 +0000 (UTC) Received: (qmail 32040 invoked by uid 500); 20 Mar 2013 17:41:33 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 31921 invoked by uid 500); 20 Mar 2013 17:41:33 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 31908 invoked by uid 99); 20 Mar 2013 17:41:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 17:41:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of t.akhayo@gmail.com designates 209.85.160.51 as permitted sender) Received: from [209.85.160.51] (HELO mail-pb0-f51.google.com) (209.85.160.51) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 17:41:27 +0000 Received: by mail-pb0-f51.google.com with SMTP id un15so1527409pbc.24 for ; Wed, 20 Mar 2013 10:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+wk9fC97eWUSNbD/92KaqVt1ZYujlN0ZLUGnnkQ+mgo=; b=mXC4jzONOyETh8T6FzMvMOzPTFAhWIOLWK/TVSR7sYo/gPJT95pwek36qqgPoC3rJP Bg+LragBS/juDBwZxB+lu/twLOCWLv2Np8hKyFAYoNfqGG5Y5qWBnezTPbOT6iEMpTQY Jdu4la6zsxtB5TIj+8fm34purVWJ7VkBrO8DitRfdPlXHXlPzNsyXIoi1fNYBCLd1KUI /S04GIX6X6qnnQ3/lFQK4aITZz9B3hOvF7de3S3X4RsBkeMVN7Tew9XrQA2F4XOSnUxU yL92kSXo5JJhd8fngUTU3XyG5yf2aD8INMyoI0BWLchf9N54gVV0U56KdlhzzM+2lt2N xMPg== MIME-Version: 1.0 X-Received: by 10.68.98.34 with SMTP id ef2mr10447107pbb.18.1363801265790; Wed, 20 Mar 2013 10:41:05 -0700 (PDT) Received: by 10.70.13.100 with HTTP; Wed, 20 Mar 2013 10:41:05 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 Mar 2013 18:41:05 +0100 Message-ID: Subject: Re: Order in which message is handled by broker plugins? From: T Akhayo To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=047d7b67262cfde85104d85eb901 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b67262cfde85104d85eb901 Content-Type: text/plain; charset=ISO-8859-1 Hi Christian, Thank you for your reply. I appreciate it. Kind regards, T. Akhayo 2013/3/20 Christian Posta > 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* > http://www.christianposta.com/blog > twitter: @christianposta > --047d7b67262cfde85104d85eb901--