4.1.2: New implementation for SSE in webserver #9297
Merged
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.
Backport of #9224 to Helidon 4.1.2
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.