You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "apupier (via GitHub)" <gi...@apache.org> on 2026/09/16 13:46:58 UTC

[PR] Replace deprecated methods in vertx platform [camel]

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

   one tricky change is to use the endOnfailure(false) on the pipe() replacing the Pump to preserve the behavior of exception
   
   co-authored-by: IBM Bob 2.0.3
   
   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   
   <!--
   You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   # AI-assisted contributions
   
   - [ ] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
   
   


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5710726389

   @jamesnetherton there is too much information on your comment. I'm not sure to follow.
   
   Which behavior changed with the a2a component? It is mentioning that it is fixing something but on the other hand to write something in release note. So is it really fixing something or an indirect positive behavior change or a change but would be better to avoid this change?
   
   What needs to be done for the spurious disconnect?


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


Re: [PR] CAMEL-24864: camel-platform-http-vertx: replace deprecated Pump with pipe(), so response write failures are no longer silent [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier merged PR #26515:
URL: https://github.com/apache/camel/pull/26515


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5711502690

   > If you'd like, I could contribute some simple changes for `AsyncInputStream` on the PR to fix that
   
   yes, please, so that we keep the main branch in the best shape possible


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5699137746

   the regen commit is unrelated to this PR.


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5713627747

   I pushed a commit for the notes I mentioned in my [previous comment](https://github.com/apache/camel/pull/26515#issuecomment-5711306297).


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on code in PR #26515:
URL: https://github.com/apache/camel/pull/26515#discussion_r4026754710


##########
components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java:
##########
@@ -269,6 +269,7 @@ public Router clear() {
     }
 
     @Override
+    @Deprecated(since = "4.23")
     public Route mountSubRouter(String mountPoint, Router subRouter) {

Review Comment:
   the method has been deprecated in the parent class



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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5698553650

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5698912778

   <!-- regen-patch -->
   ### :warning: Generated files are out of date
   
   The [CI build](https://github.com/apache/camel/actions/runs/35104142286) regenerated files that are not committed on this PR.
   
   If *Allow edits from maintainers* is enabled, a maintainer bot will automatically
   push a "Regen" commit to this branch shortly.
   
   Otherwise, you can apply the patch manually — the missing changes are available
   as the `regen-patch` artifact of that run:
   
   ```bash
   gh pr checkout 26515 --repo apache/camel
   gh run download 35104142286 --repo apache/camel -n regen-patch
   git apply --index regen.patch && rm regen.patch pr-number
   git commit -m "Regen" && git push
   ```
   
   Alternatively, run `./etc/scripts/regen.sh` locally and commit the resulting changes.
   If the patch does not apply cleanly, update the branch from the base branch first —
   the patch was generated against the merge with the base branch.


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5699202451

   > the regen commit is unrelated to this PR.
   
   provided the PR to fix it https://github.com/apache/camel/pull/26517


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5699793577

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-platform-http-vertx`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 19 tested, 26 compile-only — current: 18 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **45 affected modules** (current approach: 18).
   
   <details><summary>:warning: Modules only in Scalpel (27)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   **Skip-tests mode would test 19 modules** (2 direct + 17 downstream), **skip tests for 26** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (19)</summary>
   
   - `camel-a2a`
   - `camel-catalog`
   - `camel-jbang-mcp`
   - `camel-jbang-plugin-mcp`
   - `camel-jbang-plugin-route-parser`
   - `camel-jbang-plugin-tui`
   - `camel-jbang-plugin-validate`
   - `camel-jsonpath`
   - `camel-knative-http`
   - `camel-launcher-container`
   - `camel-mcp-server`
   - `camel-micrometer-prometheus`
   - `camel-oauth`
   - `camel-observability-services`
   - `camel-openapi-validator`
   - `camel-platform-http-main`
   - `camel-platform-http-vertx`
   - `camel-yaml-dsl-validator`
   - `camel-yaml-dsl-validator-maven-plugin`
   
   </details>
   
   <details><summary>Modules with tests skipped (26)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (45 modules, 8m 33s total)</summary>
   
   **Total reactor time:** 8m 33s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: AI :: MCP Server | 55.6s | SUCCESS |
   | Camel :: Launcher | 54.6s | SUCCESS |
   | Camel :: JBang :: MCP | 43.8s | SUCCESS |
   | Camel :: Knative HTTP | 38.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 34.1s | SUCCESS |
   | Camel :: Component DSL | 32.0s | SUCCESS |
   | Camel :: Platform HTTP :: Vert.x | 29.0s | SUCCESS |
   | Camel :: OAuth | 26.3s | SUCCESS |
   | Camel :: AI :: A2A | 24.1s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 19.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 15.5s | SUCCESS |
   | Camel :: JSon Path | 14.8s | SUCCESS |
   | Camel :: Docs | 14.6s | SUCCESS |
   | Camel :: Platform HTTP :: Main | 14.0s | SUCCESS |
   | Camel :: Kamelet Main | 10.3s | SUCCESS |
   | Camel :: OpenAPI :: Validator | 10.1s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 8.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 8.2s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.8s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 7.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 5.7s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 4.8s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 4.5s | SUCCESS |
   | Camel :: All Components Sync point | 4.4s | SUCCESS |
   | Camel :: Micrometer :: Prometheus | 3.2s | SUCCESS |
   | Camel :: Catalog :: Maven | 2.9s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 2.4s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.2s | SUCCESS |
   | Camel :: Assembly | 1.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.7s | SUCCESS |
   | Camel :: JBang :: Main | 1.3s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.3s | SUCCESS |
   | Camel :: Coverage | 1.3s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 1.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.9s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: Catalog :: Console | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.6s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 0.5s | SUCCESS |
   | Camel :: Observability Services | 0.4s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: YAML DSL | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: AI :: MCP Server` (55.6s)
   - `Camel :: Launcher` (54.6s)
   - `Camel :: JBang :: MCP` (43.8s)
   - `Camel :: Knative HTTP` (38.4s)
   - `Camel :: JBang :: Plugin :: TUI` (34.1s)
   - `Camel :: Component DSL` (32.0s)
   - `Camel :: Platform HTTP :: Vert.x` (29.0s)
   - `Camel :: OAuth` (26.3s)
   - `Camel :: AI :: A2A` (24.1s)
   - `Camel :: Catalog :: Camel Catalog` (19.9s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (15.5s)
   - `Camel :: JSon Path` (14.8s)
   - `Camel :: Docs` (14.6s)
   - `Camel :: Platform HTTP :: Main` (14.0s)
   - `Camel :: Kamelet Main` (10.3s)
   - `Camel :: OpenAPI :: Validator` (10.1s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (8.9s)
   - `Camel :: JBang :: Plugin :: Testing` (8.2s)
   - `Camel :: Catalog :: Camel Route Parser` (7.8s)
   - `Camel :: YAML DSL :: Validator` (7.7s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/35107338862)


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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #26515:
URL: https://github.com/apache/camel/pull/26515#discussion_r4052412007


##########
components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java:
##########
@@ -373,10 +374,24 @@ private void handleExchangeComplete(Exchange exchange) {
     }
 
     private void handleFailure(Exchange exchange, RoutingContext ctx, Throwable failure) {
-        getExceptionHandler().handleException(
-                "Failed handling platform-http endpoint " + getEndpoint().getPath(),
-                failure);
-        ctx.fail(failure);
+        if (ctx.response().closed()) {
+            LOGGER.debug("Client closed the connection of platform-http endpoint {} before the response completed",
+                    getEndpoint().getPath(), failure);
+        } else {
+            getExceptionHandler().handleException(
+                    "Failed handling platform-http endpoint " + getEndpoint().getPath(),
+                    failure);
+            if (!ctx.response().headWritten()) {
+                ctx.fail(failure);
+            } else if (!ctx.response().ended() && !ctx.response().closed()) {
+                // The response has already started, so there is no error status left to send, and failing the
+                // routing context would only log the failure a second time as an unhandled router exception.
+                // Reset it directly instead: the client still has to be told that the response it is reading is
+                // truncated, rather than being left waiting for a body that will never be completed.
+                ctx.response().reset(HTTP2_INTERNAL_ERROR);
+            }
+        }

Review Comment:
   ⚠️ **Race: `ctx.response().closed()` may lag behind a client abort.**
   
   Vert.x updates `closed` asynchronously on the network thread. When `pipe()` fails with a `WriteException` (client disconnected mid-stream), the `onComplete` callback fires on the event loop before the closed flag is set. This method will then fall into the `else` branch, call `getExceptionHandler().handleException(...)` (WARN-level stack trace), and call `ctx.response().reset(2)` on an already-dead connection — for every client that disconnects while downloading.
   
   Consider distinguishing write failures caused by connection loss from genuine handler errors:
   ```suggestion
       private void handleFailure(Exchange exchange, RoutingContext ctx, Throwable failure) {
           if (ctx.response().closed() || isConnectionLost(failure)) {
               LOGGER.debug("Client closed the connection of platform-http endpoint {} before the response completed",
                       getEndpoint().getPath(), failure);
           } else {
               getExceptionHandler().handleException(
                       "Failed handling platform-http endpoint " + getEndpoint().getPath(),
                       failure);
               if (!ctx.response().headWritten()) {
                   ctx.fail(failure);
               } else if (!ctx.response().ended() && !ctx.response().closed()) {
                   ctx.response().reset(HTTP2_INTERNAL_ERROR);
               }
           }
   ```
   where `isConnectionLost` checks for `io.vertx.core.impl.WriteException`, `java.io.IOException` with a connection-reset/broken-pipe message, or similar. The exact types depend on the Vert.x version in use.



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


Re: [PR] Replace deprecated methods in vertx platform [camel]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5711306297

   > @jamesnetherton there is too much information on your comment. I'm not sure to follow.
   
   Yeah - sorry for that!
   
   The commit comment states:
   
   > replacing the Pump to preserve the behavior of exception
   
   But it's not strictly true. Replacing `Pump` with `pipe()` introduces some subtle changes. `Pump` threw away the result of every `response.write()`, so failures were invisible. `pipe()` propagates them.
   
   So for scenarios where requests are aborted (e.g. due to client disconnect), you now get an additional log message & stack trace. Which could perhaps get a bit 'spammy'.
   
   If you'd like, I could contribute some simple changes for `AsyncInputStream` on the PR to fix that. Or we could merge this as-is and I could follow up later. Let me know.
   
   
   
   


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


Re: [PR] CAMEL-24864: camel-platform-http-vertx: replace deprecated Pump with pipe(), so response write failures are no longer silent [camel]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #26515:
URL: https://github.com/apache/camel/pull/26515#issuecomment-5756385375

   @apupier sorry - had to force-push to apply @gnodet-bot feedback.
   
   Also updated the PR title to reflect the proper state of the changes.
   
   


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