Add option to disable standalone SSE stream - #1080
Open
arnabnandy7 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds an
openSseStream(boolean)option toHttpClientStreamableHttpTransport.Builder, allowing clients to disable standalone GET SSE connections and operate using POST request-response flows only.Motivation and Context
The Streamable HTTP specification makes the standalone GET SSE stream optional, but the transport previously opened one automatically after session initialization.
This meant
openConnectionOnStartup(false)could prevent the initial eager connection but could not prevent the GET request triggered by the first successful POST response.When
openSseStream(false)is configured:connect().The existing behavior remains the default.
Fixes #1068.
How Has This Been Tested?
Added a regression test covering both standalone SSE connection paths:
openConnectionOnStartup(true).The test verifies that the POST request succeeds while no GET request is issued.
Automated tests have not been run locally.
Breaking Changes
No breaking changes.
openSseStreamdefaults totrue, preserving the existing transport behavior.Types of changes
Checklist
Additional context
The new option controls only the standalone SSE stream established with an HTTP GET request. It does not disable processing SSE responses returned from HTTP POST requests.
The option defaults to enabled to maintain backward compatibility: