[ 
https://issues.apache.org/jira/browse/CAMEL-12484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16639569#comment-16639569
 ] 

ASF GitHub Bot commented on CAMEL-12484:
----------------------------------------

zregvart closed pull request #2552: CAMEL-12484: setting default idletimeout 
for httpclient
URL: https://github.com/apache/camel/pull/2552
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
index 7ced1a0fc9c..daa0f130026 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
@@ -80,6 +80,7 @@
     public static final String HTTP_PROXY_REALM = "httpProxyRealm";
 
     static final int CONNECTION_TIMEOUT = 60000;
+    static final int IDLE_TIMEOUT = 5000;
     static final Pattern SOBJECT_NAME_PATTERN = 
Pattern.compile("^.*[\\?&]sObjectName=([^&,]+).*$");
     static final String APEX_CALL_PREFIX = OperationName.APEX_CALL.value() + 
"/";
 
@@ -116,7 +117,7 @@
         label = "common,security", secret = true)
     private String refreshToken;
 
-    @Metadata(description = "Username used in OAuth flow to gain access to 
access token. It's easy to get started with" 
+    @Metadata(description = "Username used in OAuth flow to gain access to 
access token. It's easy to get started with"
         + " password OAuth flow, but in general one should avoid it as it is 
deemed less secure than other flows.",
         label = "common,security")
     private String userName;
@@ -716,6 +717,7 @@ static SalesforceHttpClient createHttpClient(final 
SslContextFactory sslContextF
         // default settings, use httpClientProperties to set other
         // properties
         httpClient.setConnectTimeout(CONNECTION_TIMEOUT);
+        httpClient.setIdleTimeout(IDLE_TIMEOUT);
 
         return httpClient;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Camel-salesforce component does not try to reconnect on specific error
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-12484
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12484
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-salesforce
>    Affects Versions: 2.21.0
>            Reporter: Hemang Ajmera
>            Assignee: Zoran Regvart
>            Priority: Major
>         Attachments: logs.zip
>
>
> The issue is very much identical to CAMEL-10238 where camel component does 
> not try to reconnect. It was resolved for that particular case, however there 
> is additional scenario where we are facing exactly similar problem.
> Here is the key log message after which component stops retrying
> {{2018-05-03 17:19:50.257 WARN 7636 — [nt@911561694-23] 
> o.a.c.c.s.i.s.SubscriptionHelper : Connect failure: 
> {clientId=3qi3g4psrtqrntt15ockewu0a59q, advice=
> {reconnect=none, interval=0}
> , channel=/meta/connect, id=154, error=403::Unknown client, 
> successful=false}}}
> Please note that we are getting Connect failure multiple times but it is able 
> to reconnect where there is exception or when the advice is to do handshake 
> again. Here are those sample which works...
>  * The one with exceptions
> {quote}2018-05-03 17:19:17.965  WARN 7636 — [nt@911561694-23] 
> o.a.c.c.s.i.s.SubscriptionHelper         : Connect failure: {failure=
> Unknown macro: \{exception=java.io.EOFException}
> ],recv=HttpReceiverOverHTTP@144e8ebb(rsp=IDLE,failure=null)[HttpParser
> Unknown macro: \{s=CLOSED,0 of -1}
> ]]<-DecryptedEndPoint@245db684
> Unknown macro: \{telia-fi--dev.cs88.my.salesforce.com/85.222.137.144}
> ->HttpConnectionOverHTTP@69f41507(l:/0:0:0:0:0:0:0:1:60369 <-> 
> r:telia-fi--dev.cs88.my.salesforce.com/85.222.137.144:443,closed=false)=>HttpChannelOverHTTP@3109c579(exchange=HttpExchange@76b96e24
>  req=TERMINATED/null@null 
> res=PENDING/null@null)[send=HttpSenderOverHTTP@5d6efa04(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@43ac2f18
> Unknown macro: \{s=START}
> ],recv=HttpReceiverOverHTTP@144e8ebb(rsp=IDLE,failure=null)[HttpParser
> ]]->SocketChannelEndPoint@6b93b346
> Unknown macro: \{telia-fi--dev.cs88.my.salesforce.com/85.222.137.144}
> Unknown macro: \{io=0/0,kio=0,kro=1}
>  
> ->SslConnection@53bc7193\{NEED_WRAP,eio=-1/-1,di=-1}=>HttpConnectionOverHTTP@69f41507(l:/0:0:0:0:0:0:0:1:60369
>  <-> 
> r:telia-fi--dev.cs88.my.salesforce.com/85.222.137.144:443,closed=false)=>HttpChannelOverHTTP@3109c579(exchange=HttpExchange@76b96e24
>  req=TERMINATED/null@null 
> res=PENDING/null@null)[send=HttpSenderOverHTTP@5d6efa04(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@43ac2f18
> Unknown macro: \{s=START}
> ],recv=HttpReceiverOverHTTP@144e8ebb(rsp=IDLE,failure=null)[HttpParser
> Unknown macro: \{s=CLOSED,0 of -1}
> ]], message=\{clientId=3qi3g4psrtqrntt15ockewu0a59q, channel=/meta/connect, 
> id=153, connectionType=long-polling}, connectionType=long-polling}, 
> channel=/meta/connect, id=153, successful=false}
> {quote}
>  
>  * The one with advice for new handshake
> {quote}2018-05-03 16:31:08.970  WARN 7636 — [nt@911561694-21] 
> o.a.c.c.s.i.s.SubscriptionHelper         : Connect failure:
> Unknown macro: \{advice=Unknown macro}
> , channel=/meta/connect, id=83, error=403::Unknown client, successful=false}
> {quote}
>  
> One more thing, this log is coming from line 168 {{LOG.warn("Connect failure: 
> {}", message);}} of the 
> [https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java#L168].
>  I see that there is no attempt to reconnect. If this information helps move 
> things faster...
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to