You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/10/30 07:30:14 UTC

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #348: Fix #220 platform-http component should return 204 for success and no…

ppalaga commented on a change in pull request #348: Fix #220 platform-http component should return 204 for success and no…
URL: https://github.com/apache/camel-quarkus/pull/348#discussion_r340461185
 
 

 ##########
 File path: extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/QuarkusPlatformHttpConsumer.java
 ##########
 @@ -111,13 +111,18 @@ protected void doStart() throws Exception {
 
         newRoute.handler(
             ctx -> {
+                final Exchange exchange = toExchange(ctx);
                 try {
-                    final Exchange e = toExchange(ctx);
-                    getProcessor().process(e);
-                    writeResponse(ctx, e, getEndpoint().getHeaderFilterStrategy());
+                    createUoW(exchange);
+                    getAsyncProcessor().process(
+                        exchange,
+                        doneSync -> writeResponse(ctx, exchange, getEndpoint().getHeaderFilterStrategy())
+                    );
                 } catch (Exception e) {
                     LOG.debugf(e, "Could not handle '%s'", path);
                     ctx.fail(e);
 
 Review comment:
   Yes, I'd see `getExceptionHandler().handleException(e)` as a good replacement for the current `LOG.debugf(e, "Could not handle '%s'", path)` because the default `LoggingExceptionHandler` just does some logging and the message it logs is actually better than `Could not handle '%s'`.
   
   But we still need to mark the Vert.x `RoutingContext` as failed somehow, because otherwise it will hang forever, won't it? We have no custom ExceptionHandler on the Camel side that would do this and I see no good reason to create one, because calling `ctx.fail(e)` is much less code. 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services