-
Notifications
You must be signed in to change notification settings - Fork 566
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
New implementation for SSE in webserver #9224
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oracle-contributor-agreement
bot
added
the
OCA Verified
All contributors have signed the Oracle Contributor Agreement.
label
Aug 29, 2024
spericas
changed the title
Provides a new implementation for SSE in the webserver
Provides a new implementation for SSE in webserver
Aug 29, 2024
…tation does not use the normal output stream to serialize the events to avoid problems with buffering and chunked encoding. Instead, it writes directly to the underlying socket writer and flushes data as needed. As a result, chunked encoding is no longer used for SSE. Several tests have been updated.
spericas
force-pushed
the
issue-9164
branch
3 times, most recently
from
August 30, 2024 14:31
f22c2d3
to
7fc6e09
Compare
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
spericas
changed the title
Provides a new implementation for SSE in webserver
New implementation for SSE in webserver
Aug 30, 2024
webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java
Outdated
Show resolved
Hide resolved
webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java
Outdated
Show resolved
Hide resolved
webserver/sse/src/main/java/io/helidon/webserver/sse/SseSink.java
Outdated
Show resolved
Hide resolved
webserver/sse/src/main/java/io/helidon/webserver/sse/SseSinkProvider.java
Show resolved
Hide resolved
spericas
force-pushed
the
issue-9164
branch
from
September 20, 2024 14:58
b9cd3d2
to
fea7299
Compare
…er SSE implementation, which is also kept around. Changes to SseSink to support multiple implementations.
spericas
force-pushed
the
issue-9164
branch
from
September 23, 2024 16:19
fea7299
to
5101635
Compare
tomas-langer
approved these changes
Sep 26, 2024
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.
LGTM
I would prefer not to use an anonymous inner class in server response though.
barchetta
pushed a commit
to barchetta/helidon
that referenced
this pull request
Sep 27, 2024
Provides a new implementation for SSE in the webserver. This implementation does not use the normal output stream to serialize the events to avoid problems with buffering and chunked encoding. Instead, it writes directly to the underlying socket writer and flushes data as needed. As a result, chunked encoding is no longer used for SSE. Several tests have been updated.
barchetta
added a commit
that referenced
this pull request
Sep 27, 2024
Provides a new implementation for SSE in the webserver. This implementation does not use the normal output stream to serialize the events to avoid problems with buffering and chunked encoding. Instead, it writes directly to the underlying socket writer and flushes data as needed. As a result, chunked encoding is no longer used for SSE. Several tests have been updated. Co-authored-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
4.x
Version 4.x
OCA Verified
All contributors have signed the Oracle Contributor Agreement.
webserver
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Provides a new implementation for SSE in webserver. This implementation does not use the normal output stream to serialize the events to avoid problems with buffering and chunked encoding. Instead, it writes directly to the underlying socket writer and flushes data as needed. As a result, chunked encoding is no longer used for SSE. Several tests have been updated. Fixes #9164.
Summary of Changes
create
method inSinkProvider
that deprecates the old one. This change is required for the new implementation. Not a very popular SPI, but we shall continue to support the old method (and continue to include the old implemtnation) for some time. ClassHttp1ServerResponse
updated accordingly.SseSink
that writes directly to a writer. Also needs to write response status line and headers. No longer uses the output stream from the response.SimpleSseClient
class to test SSE endpoints without usingWebClient
. This is required because we don't use chunked encoding anymore. Related tests have been updated.