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

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

                Author: ASF GitHub Bot
            Created on: 05/Oct/23 15:22
            Start Date: 05/Oct/23 15:22
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4641:
URL: https://github.com/apache/activemq-artemis/pull/4641#discussion_r1347604650


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java:
##########
@@ -1269,7 +1269,7 @@ private AddressInfo checkAddress(RoutingContext context, 
SimpleString address) t
 
    Bindings simpleRoute(SimpleString address, RoutingContext context, Message 
message, AddressInfo addressInfo) throws Exception {
       Bindings bindings = addressManager.getBindingsForRoutingAddress(address);
-      if (bindings == null && context.getServerSession() != null) {
+      if ((bindings == null || !bindings.contains(LocalQueueBinding.class)) && 
context.getServerSession() != null) {

Review Comment:
   simpleRoute is a hot method. This would cause an iteration on bindings to 
verify if hasLocal or not. 
   
   I'm amending your commit to have the attribute cached.
   
   
   The only place this method was called (which was recently introduced) was 
during a queue creation.. and there it wouldn't be as hot as this one.





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

    Worklog Id:     (was: 883553)
    Time Spent: 20m  (was: 10m)

> Auto-deleted clustered destinations can cause message loss
> ----------------------------------------------------------
>
>                 Key: ARTEMIS-4450
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4450
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Anton Roskvist
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> If a destination has a remote binding but not a local one, certain 
> MessageLoadBalancingTypes can cause message loss, transparent to the producer.



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

Reply via email to