CometD.NetCore.Salesforce icon indicating copy to clipboard operation
CometD.NetCore.Salesforce copied to clipboard

cometD Listener does not subscribe to channel after 403 Unknown Client Error

Open tauqirghani opened this issue 2 years ago • 2 comments

My implementation of cometD.NetCore.Salesforce stops receiving any messaged from Salesforce channel I have subscribed to. My observations from network are as follows:

This is the communication Pattern: Initial call sequence /handshake /connect /subscribe

This is followed by a series of /connect loops, each lasting a fixed two minutes or so About a hundred calls later /connect gets an advice with 403: unknown client [{"advice":{"interval":0,"reconnect":"handshake"},"channel":"/meta/connect","id":"304","error":"403::Unknown client","successful":false}]

This reponse also has an additional header, not present in earlier responses Cookies/Login Set-Cookie: sfdc-stream=!//QiKCtgRz/8Ow+NBSWBTDZ6st4SZ0zgy/W9DuaUlImW4TVx0EbyUQxwr1yj6cye4+kYtTUiqXtxw=; path=/; Expires=Sun, 24-Sep-2023 19:55:37 GMT; SameSite=None; Secure

cometD then initiates /handshake and gets this reponse [{"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"1cyu4thyxh3fgv1nqwcvebt3o9x","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"305","version":"1.0","successful":true}]

Now cometD resumes /connect calls - the first response is unique, it has an advice [{"clientId":"1cyu4thyxh3fgv1nqwcvebt3o9x","advice":{"interval":0,"timeout":110000,"reconnect":"retry"},"channel":"/meta/connect","id":"306","successful":true}]

HOWEVER, at this stage there is no message received on the channel from Salesforce.

Just to be clear I am using Bayeux client, not the ResilientStreamingClient. I have added error listeners but do not receive any messages in those listeners

It appears to me that after /handshake cometD is not resubscribing to the channel. I don't see this particular issue reported here. Is it a solved problem? Then I would love to know the solution.

tauqirghani avatar Sep 25 '23 22:09 tauqirghani

My implementation of cometD.NetCore.Salesforce stops receiving any messaged from Salesforce channel I have subscribed to. My observations from network are as follows:

This is the communication Pattern: Initial call sequence /handshake /connect /subscribe

This is followed by a series of /connect loops, each lasting a fixed two minutes or so About a hundred calls later /connect gets an advice with 403: unknown client [{"advice":{"interval":0,"reconnect":"handshake"},"channel":"/meta/connect","id":"304","error":"403::Unknown client","successful":false}]

This reponse also has an additional header, not present in earlier responses Cookies/Login Set-Cookie: sfdc-stream=!//QiKCtgRz/8Ow+NBSWBTDZ6st4SZ0zgy/W9DuaUlImW4TVx0EbyUQxwr1yj6cye4+kYtTUiqXtxw=; path=/; Expires=Sun, 24-Sep-2023 19:55:37 GMT; SameSite=None; Secure

cometD then initiates /handshake and gets this reponse [{"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"1cyu4thyxh3fgv1nqwcvebt3o9x","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"305","version":"1.0","successful":true}]

Now cometD resumes /connect calls - the first response is unique, it has an advice [{"clientId":"1cyu4thyxh3fgv1nqwcvebt3o9x","advice":{"interval":0,"timeout":110000,"reconnect":"retry"},"channel":"/meta/connect","id":"306","successful":true}]

HOWEVER, at this stage there is no message received on the channel from Salesforce.

Just to be clear I am using Bayeux client, not the ResilientStreamingClient. I have added error listeners but do not receive any messages in those listeners

It appears to me that after /handshake cometD is not resubscribing to the channel. I don't see this particular issue reported here. Is it a solved problem? Then I would love to know the solution.

Did you find a solution for this?

BetimShala avatar Dec 11 '23 19:12 BetimShala