question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebSocket: Annotated Endpoints always have contextRoot /websocket

See original GitHub issue

Environment Details

  • Helidon Version: MP 2.0.0-M2
  • JDK version: 11
  • OS: Windows
  • Docker version (if applicable): N/A

Problem Description

Using Microprofile WebSocket integration only apps initialised with ServerApplicationConfig can have their contextRoot set. If using pure annotated endpoints, then this always defaults to /websocket. I feel there are two issues here:

  • Default path should not be /websocket as we may want to interleave the routing with Jersey or other routes,
  • Annotated endpoint should be inspected for @RoutingPath and that be honoured, but if it doesn’t exist, use purely the value in @ServerEndpoint#value.

Issue is here: WebSocketCdiExtension

Steps to reproduce

Create any annotated WebSocket endpoint. You’ll see the message:

INFO: Registering websocket application at /websocket

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
spericascommented, Apr 3, 2020

@dansiviter It seemed like the separation of context roots would lead to fewer user surprises, but it sounds like it had the opposite effect in your app. Perhaps we should reconsider this decision before 2.0 goes final …

0reactions
spericascommented, Apr 9, 2020

Default context root has been set to “/” for WebSocket endpoints as well (PR #1622, PR #1631). This change should be available in the next milestone release (M3).

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket: Annotated Endpoints always have contextRoot ...
Using Microprofile WebSocket integration only apps initialised with ServerApplicationConfig can have their contextRoot set. If using pure ...
Read more >
18 Using the WebSocket Protocol in WebLogic Server
To create an annotated server endpoint: Write a Plain Old Java Object (POJO) class to represent the server endpoint. The class must have...
Read more >
Spring websocket getting 404 not found - Stack Overflow
I finally found the answer myself. Since this is handled by dispatcher servlet as normal http request. I need to add @Controller annotation...
Read more >
Websocket - Massive Technical Interviews Tips
Once a WebSocket connection has been established, a Session is created and the method annotated with @OnOpen on the annotated endpoint will ...
Read more >
Spring Framework Reference Documentation
Request, session, global session, application, and WebSocket scopes ... Message listener endpoints can have a more flexible signature and benefit from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found