jamesnetherton commented on code in PR #17528:
URL: https://github.com/apache/camel/pull/17528#discussion_r2007065145


##########
components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/DefaultHttpRequestBodyHandler.java:
##########
@@ -27,21 +27,27 @@
 import static 
org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.isMultiPartFormData;
 
 /**
- * Default {@link HttpRequestBodyHandler} that will read to read the entire 
HTTP request body into memory.
+ * Default {@link HttpRequestBodyHandler} that will read the entire HTTP 
request body into memory if useBodyHandler is
+ * enabled.
  */
 class DefaultHttpRequestBodyHandler extends HttpRequestBodyHandler {
-    DefaultHttpRequestBodyHandler(Handler<RoutingContext> delegate) {
+    final boolean useBodyHandler;
+
+    DefaultHttpRequestBodyHandler(Handler<RoutingContext> delegate, boolean 
useBodyHandler) {

Review Comment:
   Nitpick - I think it'd be better to have a dedicated class, like:
   
   ```java
   class NoOpHttpRequestBodyHandler extends HttpRequestBodyHandler {
       NoOpHttpRequestBodyHandler(Handler<RoutingContext> delegate) {
           super(delegate);
       }
   
       @Override
       void configureRoute(Route route) {
       }
   
       @Override
       Future<Void> handle(RoutingContext routingContext, Message message) {
           return Future.succeededFuture();
       }
   }
   ```
   
   That way you don't pollute `DefaultHttpRequestBodyHandler` with 
`useBodyHandler` checks. WDYT?



-- 
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-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to