You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "essobedo (via GitHub)" <gi...@apache.org> on 2023/09/01 14:42:26 UTC

[GitHub] [camel] essobedo commented on a diff in pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

essobedo commented on code in PR #11279:
URL: https://github.com/apache/camel/pull/11279#discussion_r1313124942


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java:
##########
@@ -189,10 +186,27 @@ public synchronized QueueReference getOrCreateQueue(
         log.debug("Created queue {} with size {}", key, size);
 
         // create and add a new reference queue
-        ref = new QueueReference(queue, size, multipleConsumers);
+        QueueReference ref = new QueueReference(queue, size, multipleConsumers);
         ref.addReference(endpoint);
         getQueues().put(key, ref);

Review Comment:
   Maybe we should consider creating the queue and the queue reference in a computeIfAbsent to prevent concurrent creation for the same key



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org