From 33b265ca6bf5b84553500dddcf096b13683bb8c8 Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Thu, 8 Feb 2018 07:07:33 -0500 Subject: [PATCH] ARTEMIS-1633 - Include populated RoutingContext in beforeMessageRoute call There was a small bug in the previous commit, the beforeMessageRoute callback was being executed too early so the RoutingCountext wasn't being filled in --- .../artemis/core/postoffice/impl/PostOfficeImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index 9de5dcc354..12c722a2a2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -809,10 +809,6 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding message.cleanupInternalProperties(); - if (server.hasBrokerPlugins()) { - server.callBrokerPlugins(plugin -> plugin.beforeMessageRoute(message, context, direct, rejectDuplicates)); - } - Bindings bindings = addressManager.getBindingsForRoutingAddress(context.getAddress(message)); // TODO auto-create queues here? @@ -836,6 +832,10 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding } } + if (server.hasBrokerPlugins()) { + server.callBrokerPlugins(plugin -> plugin.beforeMessageRoute(message, context, direct, rejectDuplicates)); + } + if (logger.isTraceEnabled()) { logger.trace("Message after routed=" + message); }