clebertsuconic commented on code in PR #5327: URL: https://github.com/apache/activemq-artemis/pull/5327#discussion_r1825898107
########## artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java: ########## @@ -2147,10 +2151,71 @@ public void expire(final MessageReference ref, final ServerConsumer consumer, bo refCountForConsumers.check(); if (server != null && server.hasBrokerMessagePlugins()) { - server.callBrokerMessagePlugins(plugin -> plugin.messageExpired(ref, addressSettings.getExpiryAddress(), consumer)); + server.callBrokerMessagePlugins(plugin -> plugin.messageExpired(ref, settingsToUse.getExpiryAddress(), consumer)); + } + } + + + AddressSettings getMessageAddressSettings(Message message) { + if (message.getAddress().equals(String.valueOf(address))) { + return addressSettings; + } else { + return server.getAddressSettingsRepository().getMatch(message.getAddress()); } } + private void expire(final Transaction tx, final MessageReference ref, boolean delivering) throws Exception { + if (logger.isDebugEnabled()) { + logger.debug("Expiry on {}, expiryAddress={}", this.address, addressSettings.getExpiryAddress()); + } + + AddressSettings settingsToUse = getMessageAddressSettings(ref.getMessage()); + SimpleString expiryAddress = settingsToUse.getExpiryAddress(); + + if (expiryAddress != null && expiryAddress.length() != 0) { Review Comment: It was not part of my change.. it was already there before.. I only moved the expire method closer to the other expire method to make it easier to follow (we used to section private and public... and in this case I thought they should be together). But I will make the change on the other method. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact