Rajesh A created CAMEL-10259:
--------------------------------

             Summary: Not able invoke camel salesforce rest API call using 
ProducerTemplate
                 Key: CAMEL-10259
                 URL: https://issues.apache.org/jira/browse/CAMEL-10259
             Project: Camel
          Issue Type: Bug
          Components: camel-salesforce
    Affects Versions: 2.18.0
            Reporter: Rajesh A
            Priority: Critical


When I try to invoke the REST call using ProducerTemplate, I am getting Timeout 
error.

*??Here is the code that is not working:??*
+My Route config:+
from("direct:query")
        .to("salesforce:query?sObjectQuery=SELECT id, name from Account where 
id='00118DKjK1AAL'&sObjectClass=" + QueryRecordsAccount.class.getName())
        .to("log:salesforce?showAll=true");

+Code that tries to invoke this:+

ProducerTemplate producer = exchange.getContext().createProducerTemplate();
        producer.setDefaultEndpointUri("direct:query");
        QueryRecordsAccount queryRecords = 
producer.requestBody("direct:query",null, QueryRecordsAccount.class);
        LOG.debug("queryRecords : " + queryRecords);

*??Exception Log:??*
org.apache.camel.CamelExecutionException: Exception occurred during execution 
on the exchange: Exchange[ID-XXXX-YYYYY-59906-1471834914163-0-4]
        at 
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1706)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:677) 
~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:507)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:503)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:345)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
com.lmig.ci.distribution.agency.TestProcessor.process(TestProcessor.java:40) 
~[classes/:na]
        at 
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
 ~[camel-core-2.18-SNAPSHOT.jar:2.18-SNAPSHOT]
        at 
org.apache.camel.component.salesforce.SalesforceConsumer.processMessage(SalesforceConsumer.java:192)
 ~[classes/:na]
        at 
org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$5.onMessage(SubscriptionHelper.java:344)
 [classes/:na]
        at 
org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyOnMessage(AbstractClientSession.java:500)
 [cometd-java-common-3.0.9.jar:na]
        at 
org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyMessageListeners(AbstractClientSession.java:490)
 [cometd-java-common-3.0.9.jar:na]
        at 
org.cometd.common.AbstractClientSession.notifyListeners(AbstractClientSession.java:248)
 [cometd-java-common-3.0.9.jar:na]
        at 
org.cometd.client.BayeuxClient.notifyListeners(BayeuxClient.java:1001) 
[cometd-java-client-3.0.9.jar:na]
        at 
org.cometd.common.AbstractClientSession.receive(AbstractClientSession.java:241) 
[cometd-java-common-3.0.9.jar:na]
        at org.cometd.client.BayeuxClient.processMessage(BayeuxClient.java:787) 
[cometd-java-client-3.0.9.jar:na]
        at 
org.cometd.client.BayeuxClient$PublishTransportListener.processMessage(BayeuxClient.java:1193)
 [cometd-java-client-3.0.9.jar:na]
        at 
org.cometd.client.BayeuxClient$ConnectTransportListener.processMessage(BayeuxClient.java:1260)
 [cometd-java-client-3.0.9.jar:na]
        at 
org.cometd.client.BayeuxClient$PublishTransportListener.onMessages(BayeuxClient.java:1185)
 [cometd-java-client-3.0.9.jar:na]
        at 
org.cometd.client.transport.LongPollingTransport$2.onComplete(LongPollingTransport.java:258)
 [cometd-java-client-3.0.9.jar:na]
        at 
org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:446) 
[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:393) 
[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:265)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1430) 
[jetty-http-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1272) 
[jetty-http-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:156)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:117)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:69)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:89)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:122)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) 
[jetty-io-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
 [jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) 
[jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]
Caused by: org.apache.camel.component.salesforce.api.SalesforceException: 
Unexpected error {0:null} executing 
{GET:https://my.salesforce.com/services/data/v37.0/query/?q=SELECT%20id%2C%20name%20from%20Account%20where%20id%3D%2700118DKjK1AAL%27}
        at 
org.apache.camel.component.salesforce.internal.client.AbstractClientBase$1.onComplete(AbstractClientBase.java:142)
 ~[classes/:na]
        at 
org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
 [jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:446) 
[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:517) 
[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:129) 
~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.client.HttpChannel.abort(HttpChannel.java:122) 
~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:257) 
~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141) 
~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:704) 
~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
org.eclipse.jetty.client.TimeoutCompleteListener.run(TimeoutCompleteListener.java:71)
 ~[jetty-client-9.2.14.v20151106.jar:9.2.14.v20151106]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_66]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[na:1.8.0_66]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 ~[na:1.8.0_66]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 ~[na:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
~[na:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
~[na:1.8.0_66]
        ... 1 common frames omitted
Caused by: java.util.concurrent.TimeoutException: Total timeout elapsed
        ... 8 common frames omitted



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to