clebertsuconic commented on code in PR #4972:
URL: https://github.com/apache/activemq-artemis/pull/4972#discussion_r1645202926


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java:
##########
@@ -100,6 +104,11 @@ public boolean addBinding(final Binding binding) throws 
Exception {
       if (nameMap.putIfAbsent(binding.getUniqueName(), bindingAddressPair) != 
null) {
          throw ActiveMQMessageBundle.BUNDLE.bindingAlreadyExists(binding);
       }
+      directBindingMap.compute(binding.getAddress(), (key, value) -> {
+         Collection<Binding> bindingList = value == null ? new ArrayList<>() : 
value;
+         bindingList.add(binding);

Review Comment:
   Yeah.. I did some testing.. I thought the compute would do a loop retry only 
(I read the wrong code).
   
   
   I added some testing.. and I changed your code with adding sleeps and 
everything worked.. I could see the wait to lock threads.
   
   
   If you could rebase against main now that I added a test to validate this?
   
   
   also, you can verify check style by doing this:
   
   mvn -Pdev install -DskipTests=true -T2



-- 
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


Reply via email to