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


##########
dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java:
##########
@@ -302,11 +304,38 @@ public CompletableFuture<Boolean> 
dispatchAsync(JsonObject root, CliActionOutput
      * status and the other actions go on meanwhile. The transport cancels it 
when the client gives up the request.
      */
     private CompletableFuture<Boolean> repeatedSend(JsonObject root, 
CliActionOutput output) {
+        return send(output, () -> repeatedSendResult(root), () -> {
+            if (sendExecutor == null) {
+                sendExecutor = new 
ThreadPoolBuilder(camelContext).poolSize(2).maxPoolSize(2).maxQueueSize(0)
+                        
.rejectedPolicy(ThreadPoolRejectedPolicy.Abort).build("cli-send", 
"CliRepeatedSend");
+            }
+            return sendExecutor;
+        }, "Busy: two repeated sends are already running");
+    }
+
+    /**
+     * The send action of one message, on a thread of its own, as an InOut 
send or a poll waits for the reply or the
+     * message (up to the timeout of the client), and the connector thread 
must go on writing the status and looking for
+     * the lock file, which camel stop deletes (CAMEL-26911). One at a time 
and in order, as they were on the connector
+     * thread.
+     */
+    private CompletableFuture<Boolean> singleSend(JsonObject root, 
CliActionOutput output) {
+        return send(output, () -> sendResult(root), () -> {
+            if (singleSendExecutor == null) {
+                singleSendExecutor = new 
ThreadPoolBuilder(camelContext).poolSize(1).maxPoolSize(1).maxQueueSize(100)
+                        
.rejectedPolicy(ThreadPoolRejectedPolicy.Abort).build("cli-send", "CliSend");

Review Comment:
   Done in 23682a58a1e3: `cli-repeated-send` and `cli-single-send`.
   
   _Claude Code on behalf of davsclaus_



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