-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Initial version of the new declarative WebSocket server API #39142
Conversation
...next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/ConcurrencyLimiter.java
Show resolved
Hide resolved
ConcurrencyLimiter(WebSocketServerConnection connection) { | ||
this.connection = connection; | ||
this.uncompleted = new AtomicLong(); | ||
this.queueCounter = new AtomicLong(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory , if you need telemetry; you could just use the uncompleted
one which can report the number of in-flight requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queueCounter
is currently only used to distinguish queued actions in log messages. So I don't think we can use uncompleted
there. In theory, we could initialize the queueCounter
only if Logger.isDebugEnabled()
. However, I do remember some problems with native image as described in #27735.
This comment has been minimized.
This comment has been minimized.
We don't add anything special but AFAIK Vert.x does respond to a PING frame sent from the client automatically. We might need to add something for the CC @cescoffier |
Yes, Normally pong are handled automatically. However, we may want to add the possibility to send them explicitly. I'm wondering if this can be used to avoid being cut on OpenShift/Kubernetes after 10s of inactivity. |
...ployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketEndpointBuildItem.java
Show resolved
Hide resolved
|
Good point! 👍 |
...ployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketEndpointBuildItem.java
Outdated
Show resolved
Hide resolved
3a60915
to
8c7286e
Compare
This comment has been minimized.
This comment has been minimized.
8c7286e
to
e09a769
Compare
...-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketServerConnection.java
Outdated
Show resolved
Hide resolved
...sions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocket.java
Show resolved
Hide resolved
...-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketServerConnection.java
Show resolved
Hide resolved
...-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketServerConnection.java
Show resolved
Hide resolved
...-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketServerConnection.java
Outdated
Show resolved
Hide resolved
...-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketServerConnection.java
Outdated
Show resolved
Hide resolved
.../websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/Codecs.java
Outdated
Show resolved
Hide resolved
extensions/websockets-next/server/runtime/src/main/resources/META-INF/quarkus-extension.yaml
Outdated
Show resolved
Hide resolved
...oyment/src/test/java/io/quarkus/websockets/next/deployment/WebSocketServerProcessorTest.java
Show resolved
Hide resolved
...kets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/EchoMultiBidi.java
Show resolved
Hide resolved
...s-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/EchoMultiProduce.java
Show resolved
Hide resolved
@Ladicek @geoand Guys I appreciate your comments about javadoc and I'll incorporate them in this PR but keep in mind that the javadoc and docs in general is still WIP (docs do not exist yet actually ;-) and will require a lot of refinements. That said, the goal of this PR is to introduce a minimum viable product version of the API. PS. The same applies to tests. |
...server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketServerRecorder.java
Outdated
Show resolved
Hide resolved
I'm not capable of reviewing this in full, but I went through some parts that felt important (or interesting). I vaguely recall I had some ideas about codecs, but I no longer recall. Maybe I'll remember later. One thing I wanted to ask: what happens if we (at some point) introduce a CDI session context for Vert.x Web sessions (imagine only for the in-memory, non-clustered scenario, where the Vert.x Web session can store arbitrary objects)? Will it clash with the WebSocket session context added here? |
That's a good question. I think that it would depend on how and when we activate the session context. In theory, we only care about the handshake request in case WebSockets. So I assume that if the route handler of a WS endpoint has higher priority than the handler that activates the Vert.x Web session context then we're fine. And ofc it would mean that those two session contexts are completely separated. Which is IMO fine if properly documented. |
- see also quarkusio#38473 Co-authored-by: Clement Escoffier <[email protected]>
e09a769
to
d73514d
Compare
That's why my comment explicitly mentioned the |
Status for workflow
|
This pull request supersedes #38783.