[ 
https://issues.apache.org/jira/browse/ARTEMIS-5119?focusedWorklogId=941382&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-941382
 ]

ASF GitHub Bot logged work on ARTEMIS-5119:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Nov/24 14:39
            Start Date: 01/Nov/24 14:39
    Worklog Time Spent: 10m 
      Work Description: 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.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 941382)
    Time Spent: 0.5h  (was: 20m)

> Messages that expire in store-and-forward (sf-) queues should go to original 
> queue's configured expiry queue
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5119
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5119
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.37.0
>            Reporter: Rakhi Kumari
>            Assignee: Clebert Suconic
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.39.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When messages expire in the store-and-forward queues, they go to the 
> store-and-forward queue's expiry queue. It would be better if the messages go 
> to the original queue's expiry queue.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to