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

How to handle Exception from WebsocketTransport in cometD5? #1298

Open
TienTungs295 opened this issue Feb 15, 2023 · 2 comments
Open

How to handle Exception from WebsocketTransport in cometD5? #1298

TienTungs295 opened this issue Feb 15, 2023 · 2 comments
Labels

Comments

@TienTungs295
Copy link

TienTungs295 commented Feb 15, 2023

Hello everyone,
In cometD2 I have handled Exception by override handleException from WebSocketTransport class (cometd-websocket-jetty:2.9.0)
package cn.nextop.social.front.web.support.cometd;

import org.cometd.bayeux.server.ServerSession;
import org.cometd.server.BayeuxServerImpl;
import org.cometd.websocket.server.WebSocketTransport;
import org.eclipse.jetty.websocket.WebSocket;

import java.io.IOException;

public class CustomizedWebSocketTransport extends WebSocketTransport {
public CustomizedWebSocketTransport(BayeuxServerImpl bayeux) {
super(bayeux);
}

@Override
protected void handleException(WebSocket.Connection wsSession, ServerSession session, Throwable exception) {
	if (!(exception instanceof IOException)) super.handleException(wsSession, session, exception);
}

}

But after upgrading to cometD5 , the handleException function is removed in WebSocketTransport class (cometd-java-server-websocket-javax:5.0.0) and I cannot handle Exception .
Does anyone have a solution?
Thanks!

@sbordet
Copy link
Member

sbordet commented Feb 15, 2023

CometD 5 is at End of Community Support, see #1179.
You should upgrade to CometD 6 or CometD 7.

@sbordet
Copy link
Member

sbordet commented Feb 15, 2023

In CometD 5+, the method handleException() has been removed, since it was just logging the exception.

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

No branches or pull requests

2 participants