[ 
https://issues.apache.org/jira/browse/CAMEL-19182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768024#comment-17768024
 ] 

Federico Mariani edited comment on CAMEL-19182 at 9/22/23 1:52 PM:
-------------------------------------------------------------------

Hi [~davsclaus] I was looking into it, do you think that instead of [this void 
method|https://github.com/apache/camel-spring-boot/blob/5abd664f7cd9490e1546da98c3eaa04a799424b1/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java#L59]
 , return a _CompletableFuture_ like this _CompletableFuture.runAsync(() -> { 
... })_, would be enough?

With that change the tests are green, but they are basic, and I compared the 
stack trace with a spring method like this
{code:java}
@GetMapping("/async_result")
                @Async
                public CompletableFuture<String> ...
{code}
and the stack traces are similar, I can see the Async stack trace in both cases.

If you think I am on a good path, I can add more tests so that we can ensure it 
works as it should.


was (Author: federico mariani):
Hi [~davsclaus] I was looking into it, do you think that instead of [this void 
method|https://github.com/apache/camel-spring-boot/blob/5abd664f7cd9490e1546da98c3eaa04a799424b1/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java#L59]
 , return a CompletableFuture like this CompletableFuture.runAsync(() -> { ... 
}), would be enough?

With that change the tests are green, but they are basic, and I compared the 
stack trace with a spring method like this
{code:java}
@GetMapping("/async_result")
                @Async
                public CompletableFuture<String> ...
{code}
and the stack traces are similar, I can see the Async stack trace in both cases.

If you think I am on a good path, I can add more tests so that we can ensure it 
works as it should.

> camel-platform-http-starter - Async processing with Spring Boot
> ---------------------------------------------------------------
>
>                 Key: CAMEL-19182
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19182
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-platform-http, camel-spring-boot-starters
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: Future
>
>
> Continuation of CAMEL-19177 where we should look at if we can use 
> CompletionStage for async processing and response with Spring Boot HTTP 
> server like we do in vertx and Camel.
> See TODO in SpringBootPlatformHttpConsumer



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to