Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tauqirghani opened this issue Sep 25, 2023 · 1 comment

Comments

@tauqirghani
Copy link

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.

@BetimShala
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants