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

Support Decoder lists on javax.websocket endpoints #3428

Closed
joakime opened this issue Mar 5, 2019 · 3 comments · Fixed by #4902
Closed

Support Decoder lists on javax.websocket endpoints #3428

joakime opened this issue Mar 5, 2019 · 3 comments · Fixed by #4902
Assignees

Comments

@joakime
Copy link
Contributor

joakime commented Mar 5, 2019

Currently, the implementation of javax.websocket on Jetty does not support Decoder lists properly.
This was identified during the analysis of the Decoder.Text.willDecode() and Decoder.Binary.willDecode() reported issues.

Some apparent rules:

  • If an endpoint has multiple Decoders, the decoders are supposed to be filtered by TEXT vs BINARY and then each decoder is used in the order supplied by the application.
  • If the Decoder is a Decoder.Text or Decoder.Binary then the willDecode must be called. (what the previous issue addressed)
  • If the Decoder is a Decoder.TextStream or Decoder.BinaryStream then that decoder is used for the appropriate raw data frame. (there is no willDecode for streaming decoders)
  • If all of the application supplied decoders are skipped (presumably due to all false responses from willDecode) then the built-in decoders from jetty are used.
  • If the decoded object has no matching @OnMessage method, then that object is discarded, and the application @OnError is called saying so.
  • If the raw TEXT or BINARY has no decoder match, then @OnError is called indicating as such. (this isn't possible, but its a behavior that is called out in the discussion of decoders on the javax.websocket api issue tracker)
@joakime
Copy link
Contributor Author

joakime commented Mar 5, 2019

The rules in @OnMessage still only allow for an endpoint to have 1 each of (TEXT / BINARY / PONG).
Where TEXT and BINARY has options of (whole, partial, object/decoded).

The discovery of the methods hasn't changed, but the association of method to decoder has with this issue.

With this issue, it is possible to have a decoder list pointing to an object based onMessage method.
Only @OnMessage delivery to partial messages are immune from this issue, as they don't have decoders.

@stale
Copy link

stale bot commented Mar 4, 2020

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Mar 4, 2020
@joakime joakime removed the Stale For auto-closed stale issues and pull requests label Mar 4, 2020
@joakime joakime removed their assignment Mar 4, 2020
@joakime
Copy link
Contributor Author

joakime commented Mar 4, 2020

@lachlan-roberts we should look into this for Jetty 10

@lachlan-roberts lachlan-roberts self-assigned this Mar 6, 2020
lachlan-roberts added a commit that referenced this issue May 20, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue May 21, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue May 21, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue May 21, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue May 28, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jun 29, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jun 29, 2020
…orrect order

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jun 29, 2020
…EndpointConfig

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jun 29, 2020
…view

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jun 30, 2020
Issue #3428 - support javax websocket decoder lists in jetty-10
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

Successfully merging a pull request may close this issue.

2 participants