davsclaus opened a new pull request, #29935:
URL: https://github.com/apache/camel/pull/29935

   Part of item 4 of 
[CAMEL-26929](https://issues.apache.org/jira/browse/CAMEL-26929): `camel cmd 
send --timeout` only bounded how long the CLI waits.
   
   ## Problem
   
   - `camel cmd send` passes `--timeout` to the send console as `pollTimeout`, 
and the console used it for `--poll` only (plus 5 seconds). A send was a 
blocking `producer.send` without a bound. `camel cmd send 
--endpoint=direct:nope` waited the 30 seconds that direct waits for a consumer, 
the CLI gave up first, and it ended in a CLI timeout (exit 124) instead of "No 
consumers available".
   - A `--timeout` below 5000 was raised to 5000 without a word.
   
   ## Change
   
   camel-console, `SendDevConsole`:
   
   - The send is bounded by the timeout: it is sent with `asyncSend`, and when 
it has not completed within the timeout, the answer is status `timeout` with 
"The send did not complete within <n> millis (the exchange goes on in the 
integration)". The CLI shows `Timeout` and exits 124, now with the reason from 
the integration and before its own wait runs out. A poll waits the timeout as 
given, without the extra 5 seconds; the CLI waits the timeout plus 10 seconds 
for the answer.
   - A send to a `direct` endpoint that no route consumes from fails at once 
with "No consumers available on endpoint: direct://nope" (status `error`, exit 
1). The console checks the routes, so camel-console does not depend on 
camel-direct.
   - The description of `pollTimeout` says that it bounds the send too (the 
generated `send.json` and the catalog copies).
   
   Camel CLI, `CamelSendAction`: `--timeout` is passed as given; 0 or less is a 
usage error (exit 2).
   
   The repeated sends (`--repeat`, a folder) go through the same console, a 
message at a time. The MCP and TUI send tools do not pass `pollTimeout`, so 
their sends are bounded by the default of 20 seconds.
   
   The 4.24 upgrade guide has a line in the exit codes entry.
   
   ## Tests
   
   - `SendDevConsoleTest` (new, against a started console):
     - a route with a 2 second delay and a timeout of 200 answers `timeout` 
within 1.5 seconds, with the message;
     - an InOut send within the timeout is `success` with the reply;
     - `direct:nope` is `error` with "No consumers available" within 1.5 
seconds, and `direct:start?timeout=1000` still reaches the route of 
`direct:start`.
     The first and the last fail without the change; the direct one waited 30 
seconds.
   - `CamelSendActionResultTest`: `--timeout=100` is sent as 100 (was 5000), 
and `--timeout=0` is a usage error.
   - camel-console: 294 pass. camel-jbang-run: 303. camel-jbang-core: 3003 + 
259 pass (`DependencyUpdateTest` and four `ExportTest` cases failed once and 
passed on the rerun, as on other branches).
   
   Not tested end to end with the launcher: the console change needs a Camel 
built with it, and the console tests use a real CamelContext.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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