davsclaus commented on code in PR #26847:
URL: https://github.com/apache/camel/pull/26847#discussion_r4092964719


##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java:
##########
@@ -1973,6 +1967,46 @@ public int forceDiscardingOfAllGroups() {
         return total;
     }
 
+    /**
+     * Completes the group and sends the aggregated exchange. Must be called 
while holding the lock.
+     *
+     * @return <tt>false</tt> if another Camel instance completed the group 
first (optimistic locking)

Review Comment:
   Applied in 371c640c2864, together with the other Javadoc comment.
   
   _Claude Code on behalf of Claus Ibsen_



##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java:
##########
@@ -1973,6 +1967,46 @@ public int forceDiscardingOfAllGroups() {
         return total;
     }
 
+    /**
+     * Completes the group and sends the aggregated exchange. Must be called 
while holding the lock.
+     *
+     * @return <tt>false</tt> if another Camel instance completed the group 
first (optimistic locking)
+     */
+    private boolean forceCompletion(String key, Exchange exchange) {
+        try {
+            Exchange answer = onCompletion(key, exchange, exchange, false, 
false);
+            if (answer != null) {
+                onSubmitCompletion(key, answer);
+            }
+            return true;
+        } catch 
(OptimisticLockingAggregationRepository.OptimisticLockingException e) {
+            LOG.debug("Another Camel instance has already completed the group 
with correlation key: {}", key);
+            return false;
+        }
+    }
+
+    /**
+     * Discards the group. Must be called while holding the lock.
+     *
+     * @return <tt>false</tt> if another Camel instance completed the group 
first (optimistic locking)

Review Comment:
   Applied in 371c640c2864, together with the other Javadoc comment.
   
   _Claude Code on behalf of Claus Ibsen_



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to