-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #11307 - Explicit demand control in WebSocket endpoints with only onWebSocketFrame #12342
base: jetty-12.1.x
Are you sure you want to change the base?
Issue #11307 - Explicit demand control in WebSocket endpoints with only onWebSocketFrame #12342
Conversation
…ly onWebSocketFrame Signed-off-by: Lachlan Roberts <[email protected]>
Solution 1. Keep current behavior.The problem is that by only having Solution 2. Deprecate/Remove
|
I definitely don't like solution 3 as it comes with too many surprising behaviors. Now, between solutions 1 and 2, I'm not sure which ones is best. It feels like we would like a new mechanism incompatible with the existing one, but still keep the existing one for backward compatibility. Do we want to maintain both? In that case, would something similar to the client's |
@lorban the "single mechanism" would be The idea with the "high" level WebSocket APIs is that applications need only to override what they are interested in (for example, only text messages), and only write application logic. |
I agree that solution 3 is too tricky for someone to write their application correctly. Didn't we add some rule that to remove a method we need to deprecate it for 6months + x dot releases. So if we follow that rule we can never remove it for 12.1.x anyway. So we could just deprecate in 12.1.0 and remove in the next major release? Another alternative would be to not deprecate it, but enforce that if they use the |
About failing the deployment, I think we already forbid the case where an application overrides both The case of Solution 4. Restrict deployment I prefer Solution 2 because Solution 4 would work at deployment, but then likely break the application. |
Well I'm assuming solution 2 is really to deprecate it because of our new removal policy, so very similar to solution 1. |
I'm currently "none of the above". Let me get my head into this a bit more.... stand by.... |
Issue #11307
Support endpoints in the Jetty WebSocket API to be use only a
onWebSocketFrame
method. They should demand in theonWebSocketFrame
if they don't have another handler registered for this frame type.There are some surprising changes of behavior needed to implement this which will likely surprise users if they are using
onWebSocketFrame
.onWebSocketFrame
and noonWebSocketPing
method defined, then we now expect the user to handlePING
frames in theironWebSocketFrame
, so we will no longer send an automatic frame in this case.onWebSocketText
and noonWebSocketBinary
and also aonWebSocketFrame
, then they would now be expected to demand forBINARY
/CONTINUATION
opCodes in theonWebSocketFrame
method.