You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2024/04/15 07:38:00 UTC
[jira] [Assigned] (CAMEL-20388) Salesforce component does not handshake on the connection failure
[ https://issues.apache.org/jira/browse/CAMEL-20388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-20388:
-----------------------------------
Assignee: Zheng Feng
> Salesforce component does not handshake on the connection failure
> -----------------------------------------------------------------
>
> Key: CAMEL-20388
> URL: https://issues.apache.org/jira/browse/CAMEL-20388
> Project: Camel
> Issue Type: Bug
> Components: camel-salesforce
> Affects Versions: 3.22.1
> Reporter: Bartosz Popiela
> Assignee: Zheng Feng
> Priority: Major
> Fix For: 3.21.5, 3.22.2, 4.0.5, 4.4.2, 4.6.0
>
>
> We use the Salesforce component to consume platform events and every 3 hours we observe the following warning message:
> {noformat}
> Connect failure: {advice={reconnect=handshake, interval=0}, channel=/meta/connect, id=2005814, error=403::Unknown client, successful=false}
> {noformat}
> According to [this|https://help.mulesoft.com/s/article/Couldn-t-connect-to-Salesforce-streaming-server-because-a-403-error-has-been-returned-error-403-Unknown-client-Warning-messages-in-log] article, it is caused by the expiring sfdc-stream cookie used by CometD. When it happens, the client is expected to perform a new handshake and re-subscribe to the channels. This is handled in connectListener (_SubscriptionHelper#initMessageListeners_). Unfortunately, because the client is in the CONNECTED state when this message is received, the condition
> {code:java}
> while (!abort && !client.isDisconnected()) {
> try {
> Thread.sleep(DISCONNECT_INTERVAL);
> } catch (InterruptedException e) {
> LOG.error("Aborting handshake on interrupt!");
> abort = true;
> }
> abort = abort || isStoppingOrStopped();
> }
> {code} (_SubscriptionHelper#doHandshake_) is not met and it stays in the handshaking state indefinitely (_SubscriptionHelper#handshaking_), hence the handshake is not being performed. As a consequence, after a couple of days the client stops receiving Salesforce events.
> This bug may have been introduced by [this|https://github.com/apache/camel/commit/7a6315a73569f92a234a948a11cf4fc5478701c0#diff-fd8ac20f7b12e53a2e26d69754c9496a1c374377650c36979ac1d6d52c80fbe0] commit, which removed
> {code:java}
> client.disconnect();
> {code}
> from connectListener (_SubscriptionHelper:178_).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)