Details
Description
We use the Salesforce component to consume platform events and every 3 hours we observe the following warning message:
Connect failure: {advice={reconnect=handshake, interval=0}, channel=/meta/connect, id=2005814, error=403::Unknown client, successful=false}
According to this 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
while (!abort && !client.isDisconnected()) { try { Thread.sleep(DISCONNECT_INTERVAL); } catch (InterruptedException e) { LOG.error("Aborting handshake on interrupt!"); abort = true; } abort = abort || isStoppingOrStopped(); }
(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 commit, which removed
client.disconnect();
from connectListener (SubscriptionHelper:178).
Attachments
Issue Links
- is related to
-
CAMEL-12484 Camel-salesforce component does not try to reconnect on specific error
- Resolved
- relates to
-
CAMEL-20918 Salesforce component does not resubscribe after exception
- Resolved
- links to