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

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

                Author: ASF GitHub Bot
            Created on: 15/Mar/24 03:10
            Start Date: 15/Mar/24 03:10
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4681:
URL: https://github.com/apache/activemq-artemis/pull/4681#discussion_r1525706187


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java:
##########
@@ -136,6 +139,21 @@ public void route(final Message message, final 
RoutingContext context) throws Ex
 
             // We call reencode at the end only, in a single call.
             copy.reencode();
+
+            if 
(postOffice.getAddressSettingsMatch(copy.getAddress()).isAutoCreateDivertDestination())
 {

Review Comment:
   Instead of getAddressSettingsMatch on every message (which will actually 
have a negative perf impact for any case), you should rather check once, and 
register a listener on the HierarchicalRepositoryChangeListener.
   
   This is how actually page updates the maxPage data after anything is changed:
   
   
https://github.com/apache/activemq-artemis/blob/89c3a627e9ca2b1ef48a6411d372c32f90a6f9ed/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java#L192-L194
   
   
   you could also have such listener done on a higher level and call every 
Divert to recalculate attributes (that would be less risky of leaks, say a 
Divert being unregistered would leak on the Listener).
   
   





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

    Worklog Id:     (was: 910012)
    Time Spent: 2h 50m  (was: 2h 40m)

> Add auto-create-destination logic to diverts
> --------------------------------------------
>
>                 Key: ARTEMIS-4510
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4510
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Anton Roskvist
>            Priority: Major
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> This enables the use of dynamic routing decisions within the transformer by 
> setting the message address. It also covers for a rare problem where if any 
> of the forwarding addresses are removed during runtime, such as from 
> auto-delete, the message would get silently dropped.



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

Reply via email to