0

For streaming API, does server force disconnect client after some time? If true, then how long the time is?

Didn't find any documentation about this, but we found sometimes the client can't receive notification anymore.

My client keep re-connect to Salesforce around every 2min(110seconds):

 2018/07/06 10:41:29.297785 Response Body: [{"clientId":"xxx","channel":"/meta/connect","successful":true}]
---reconnect call ---  

2018/07/06 10:43:19.490729 Response Body: [{"clientId":"xxx","channel":"/meta/connect","successful":true}]
---reconnect call ---  

2018/07/06 10:45:09.773423 Response Body: [{"clientId":"xxx","channel":"/meta/connect","successful":true}]
---reconnect call ---  

2018/07/06 10:46:59.962616  Response Body: [{"clientId":"xx","channel":"/meta/connect","successful":true}]
---reconnect call ---

This looks good to keep the long-lived connection open, but sometimes, after serval hours(maybe 24hrs or more or less), i saw error like:

Cannot connect to bayeux Unknown error: Post https://ap1.salesforce.com/cometd/38.0: EOF

Tested in 2 different envs, only one env encountered this issue, another is fine? So is the error because of network or salesforce server get down at that moment? Or salesforce streaming API disconnect client for sometimes?

  • So is the error because of network or salesforce server get down at that moment? - Did you verify if the instance was down or was undergoing maintenance at the time of your issue? – Jayant Das Jul 9 '18 at 19:13
  • No, the sever was not in maintenance at that time. – zgcharley Jul 10 '18 at 15:07
  • Do you see any error code along with the message? – Jayant Das Jul 10 '18 at 15:25
  • No too much info, only I see is " Cannot connect to bayeux Unknown error: Post ap1.salesforce.com/cometd/38.0: EOF 2 2018-Jul-06 08:26:42:492 [N/A] " – zgcharley Sep 27 '18 at 22:29
0

Still believe this is due to intermittent network problem which makes the long connection hand shake get failed.

The solution for me is to read /meta/connect channel, is successful is false then do re-handshake and subscribe again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.