This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new a70f09d2ee14 chore(components): platform http vertx stream closure 
design note
a70f09d2ee14 is described below

commit a70f09d2ee1442502ccde0d3d13c59dc26c4c58d
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Fri Nov 28 13:23:17 2025 +0100

    chore(components): platform http vertx stream closure design note
    
    Additionally fixed minor compilation warnings
---
 .../platform/http/vertx/StreamingHttpRequestBodyHandler.java          | 3 ++-
 .../component/platform/http/vertx/VertxPlatformHttpConsumer.java      | 3 +--
 .../org/apache/camel/component/platform/http/vertx/PathCreator.java   | 4 ++--
 .../component/platform/http/vertx/VertxPlatformHttpEngineTest.java    | 2 --
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/StreamingHttpRequestBodyHandler.java
 
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/StreamingHttpRequestBodyHandler.java
index 88531a6a07ed..9219b0e14d13 100644
--- 
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/StreamingHttpRequestBodyHandler.java
+++ 
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/StreamingHttpRequestBodyHandler.java
@@ -61,7 +61,8 @@ class StreamingHttpRequestBodyHandler extends 
HttpRequestBodyHandler {
             request.endHandler(promise::complete);
         } else {
             // Process each body 'chunk' and write it to CachedOutputStream
-            CachedOutputStream stream = new 
CachedOutputStream(message.getExchange(), true);
+            // NOTE: the stream is going to be closed on endHandler event.
+            CachedOutputStream stream = new 
CachedOutputStream(message.getExchange(), true); // NOSONAR
             AtomicReference<Exception> failureCause = new AtomicReference<>();
             request.handler(buffer -> {
                 try {
diff --git 
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
 
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
index 2c7b19ca6ba9..bdb843a6447a 100644
--- 
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
+++ 
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
@@ -45,7 +45,6 @@ import org.apache.camel.ExchangePropertyKey;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.Suspendable;
-import org.apache.camel.SuspendableService;
 import org.apache.camel.attachment.AttachmentMessage;
 import org.apache.camel.attachment.CamelFileDataSource;
 import org.apache.camel.component.platform.http.PlatformHttpEndpoint;
@@ -71,7 +70,7 @@ import static 
org.apache.camel.util.CollectionHelper.appendEntry;
  * based on Vert.x Web.
  */
 public class VertxPlatformHttpConsumer extends DefaultConsumer
-        implements PlatformHttpConsumer, Suspendable, SuspendableService {
+        implements PlatformHttpConsumer, Suspendable {
     private static final Logger LOGGER = 
LoggerFactory.getLogger(VertxPlatformHttpConsumer.class);
     private static final Pattern PATH_PARAMETER_PATTERN = 
Pattern.compile("\\{([^/}]+)\\}");
 
diff --git 
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/PathCreator.java
 
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/PathCreator.java
index c65bc9499f88..b21c276d932d 100644
--- 
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/PathCreator.java
+++ 
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/PathCreator.java
@@ -16,10 +16,10 @@
  */
 package org.apache.camel.component.platform.http.vertx;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Strings;
 
 public class PathCreator {
     public String createNewUri(String uri) {
-        return "vertx-http:" + StringUtils.replaceOnce(uri, "/camel", "");
+        return "vertx-http:" + Strings.CS.replaceOnce(uri, "/camel", "");
     }
 }
diff --git 
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
 
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
index cbfe720f984c..6cf069d9df7b 100644
--- 
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
+++ 
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
@@ -63,7 +63,6 @@ import 
org.apache.camel.support.jsse.SSLContextServerParameters;
 import org.apache.camel.support.jsse.TrustManagersParameters;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.hc.client5.http.utils.Base64;
-import org.hamcrest.Matcher;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
@@ -795,7 +794,6 @@ public class VertxPlatformHttpEngineTest {
                         .then()
                         .statusCode(200);
 
-                Matcher<String> expectedBody;
                 if (method.equals(Method.HEAD)) {
                     // HEAD response body is ignored
                     validatableResponse.body(emptyString());

Reply via email to