This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 8610f30  [CAMEL-16291]camel-cxfrs producer shouldn't try to read 
Entity from javax.ws.rs.core.Response
8610f30 is described below

commit 8610f301abdfc12fc0ee395ef7ee59f56d691827
Author: Freeman Fang <freeman.f...@gmail.com>
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
---
 .../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 {

Reply via email to