This is an automated email from the ASF dual-hosted git repository.
ffang pushed a commit to branch camel-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.7.x by this push:
new b404b58 [CAMEL-16291]camel-cxfrs producer shouldn't try to read
Entity from javax.ws.rs.core.Response
b404b58 is described below
commit b404b58fdab82fc9cecf7de5594ed81ba924cad7
Author: Freeman Fang <[email protected]>
AuthorDate: Tue Mar 2 14:12:31 2021 -0500
[CAMEL-16291]camel-cxfrs producer shouldn't try to read Entity from
javax.ws.rs.core.Response
(cherry picked from commit 8610f301abdfc12fc0ee395ef7ee59f56d691827)
---
.../org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index 0756d56..3c2b2e5 100644
---
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -181,8 +181,14 @@ public class CxfRsProducer extends DefaultAsyncProducer {
loadCookies(exchange, client, cookieHandler);
// invoke the client
- client.async().method(httpMethod, entity,
- new CxfInvocationCallback(client, exchange, cxfRsEndpoint,
responseClass, callback, genericType));
+ if (responseClass == null || Response.class.equals(responseClass)) {
+ client.async().method(httpMethod, entity,
+ new CxfInvocationCallback(client, exchange, cxfRsEndpoint,
null, callback, null));
+ } else {
+ client.async().method(httpMethod, entity,
+ new CxfInvocationCallback(client, exchange, cxfRsEndpoint,
responseClass, callback, genericType));
+ }
+
}
protected void invokeAsyncProxyClient(Exchange exchange, final
AsyncCallback callback) throws Exception {