You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Federico Mariani (Jira)" <ji...@apache.org> on 2024/10/04 09:53:00 UTC

[jira] [Work started] (CAMEL-21318) camel-platform-http-starter executed on multiple async threads

     [ https://issues.apache.org/jira/browse/CAMEL-21318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-21318 started by Federico Mariani.
------------------------------------------------
> camel-platform-http-starter executed on multiple async threads
> --------------------------------------------------------------
>
>                 Key: CAMEL-21318
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21318
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-platform-http, camel-spring-boot
>    Affects Versions: 4.8.0
>            Reporter: Federico Mariani
>            Assignee: Federico Mariani
>            Priority: Major
>             Fix For: 4.8.1, 4.9.0
>
>
> The actual implementation of camel-platform-http-starter is not working as expected, in particular, when using undertow for example, after a couple of request the following exception is thrown:
> {code:java}
> 2024-10-03T15:13:32.116+02:00  WARN 981444 --- [onPool-worker-1] c.c.p.h.s.SpringBootPlatformHttpConsumer : Error handling request due to: Invalid parameter, expected to be a pair but was hello
> java.lang.IllegalArgumentException: Invalid parameter, expected to be a pair but was hello
> 	at org.apache.camel.http.common.DefaultHttpBinding.readFormUrlEncodedBody(DefaultHttpBinding.java:294) ~[camel-http-common-4.8.0.redhat-00004.jar!/:4.8.0.redhat-00004]
> 	at org.apache.camel.http.common.DefaultHttpBinding.readRequest(DefaultHttpBinding.java:129) ~[camel-http-common-4.8.0.redhat-00004.jar!/:4.8.0.redhat-00004]
> 	at org.apache.camel.component.platform.http.springboot.PlatformHttpMessage.init(PlatformHttpMessage.java:64) ~[camel-platform-http-starter-4.8.0.redhat-00010.jar!/:4.8.0.redhat-00010]
> 	at org.apache.camel.component.platform.http.springboot.PlatformHttpMessage.<init>(PlatformHttpMessage.java:39) ~[camel-platform-http-starter-4.8.0.redhat-00010.jar!/:4.8.0.redhat-00010]
> 	at org.apache.camel.component.platform.http.springboot.SpringBootPlatformHttpConsumer.handleService(SpringBootPlatformHttpConsumer.java:91) ~[camel-platform-http-starter-4.8.0.redhat-00010.jar!/:4.8.0.redhat-00010]
> 	at org.apache.camel.component.platform.http.springboot.SpringBootPlatformHttpConsumer.lambda$service$0(SpringBootPlatformHttpConsumer.java:66) ~[camel-platform-http-starter-4.8.0.redhat-00010.jar!/:4.8.0.redhat-00010]
> 	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[na:na]
> 	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[na:na]
> 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[na:na]
> 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[na:na]
> 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[na:na]
> 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[na:na]
> 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[na:na]
> {code}
> The route to reproduce this issue is the following, a really trivial one:
> {code:java}
> rest().post("/message").consumes("text/plain").to("direct:route");
>         from("direct:route").log("${body}");
> {code}
> Analyzing the stacktrace you can notice that we are mixing Async execution via CompletableFuture and non-Async Spring Boot code, therefore a single request is executed on multiple threads not handled by the underlying server or spring boot, that causes the concurrent modification exception.



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