rwalker
rwalker

Reputation: 321

cometd returning "402::Unknown Client" error immediately after doing handshake

I have an application built using CometD Java that has been deployed to a number of client hosting instances and is working fine. However, in recent client implementation we having an issue where the cometd long-polling requests are returning a "402::Unknown Client" error immediately after doing the handshake.

So the browser attempts another handshake, which is successful, but then again it returns a 402::Unknown Client error on the very next request. And so on it repeats likes this.

I can't see any differences between this client implementation and the previous ones (same jboss/apache versions, etc.) so I'm stuck as to why this is happening.

Appreciate any thoughts or suggestions.

Thank you.

Upvotes: 2

Views: 1643

Answers (1)

sbordet
sbordet

Reputation: 18637

Very likely the load balancer is not sticking the same client to the same server, and it must do so.

The best approach is to stick on the client IP address, as this will work for both HTTP and WebSocket transports; alternatively, you can stick on the BAYEUX_BROWSER cookie that CometD sends.

Further alternatives involve creating a HTTP session and use its cookie, but this rules out the WebSocket transport (or you have to have another mechanism for that).

Upvotes: 0

Related Questions