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); }