[
https://issues.apache.org/jira/browse/CAMEL-16906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17411023#comment-17411023
]
Pasquale Congiusti commented on CAMEL-16906:
--------------------------------------------
I managed to give a look and here my assessment:
# certain dataformats (ie, the json ones) still need a conversion to
InputStream so we need to make some code change to them. However the impact
will be reduced as many other have an InputStream fallback converter.
# as far I can understand from the code, the Vert.x component is designed to
prefer java.nio.ByteBuffer for performances reason. [~lburgazzoli], I've seen
you originally developed the [part involved in this
discussion|https://github.com/apache/camel/blob/main/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java#L183].
I'd appreciate if you can confirm this thought.
Given this quick analysis, my proposal is to still *try* to convert to
ByteBuffer as it is now but if that is not available, to finally fallback to
InputStream. In this way we should be able to maintain compatibility and keep
the original design.
> Platform-http components fail when using unmarshal
> --------------------------------------------------
>
> Key: CAMEL-16906
> URL: https://issues.apache.org/jira/browse/CAMEL-16906
> Project: Camel
> Issue Type: Bug
> Components: camel-platform-http-vertx
> Affects Versions: 3.11.1, 3.12.0
> Reporter: Pasquale Congiusti
> Assignee: Pasquale Congiusti
> Priority: Major
> Fix For: 3.11.2, 3.12.0
>
>
> When we run a route which is using platform-http component and we try to
> unmarshal to json (and I suspect also any other dataformat), there is a
> failure due to a missing conversion type.
> For example:
> {code}
> from("platform-http:/hello?httpMethodRestrict=GET").
> setBody(simple("{\"hello\": \"world\"}"))
> .unmarshal().json();
> {code}
> Will fail because there is a [mandatory conversion from Map to
> ByteBuffer|https://github.com/apache/camel/blob/main/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java#L183]
> that is failing.
> {code}
> [1] 2021-08-31 13:41:58,676 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler]
> (vert.x-eventloop-thread-1) HTTP Request to /hello failed, error id:
> 3ea4fdb8-931c-4d59-b8e6-376dc6a34e09-1:
> org.apache.camel.NoTypeConversionAvailableException: No type converter
> available to convert from type: java.util.LinkedHashMap to the required type:
> java.nio.ByteBuffer with value {hello=world}
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)