Repository navigation
Add SSE Support to RestClient #35164
Description
Activity
- addedstatus: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on
on Jul 7, 2025 - addedin: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)
on Jul 7, 2025 I believe this is related: #34290
- addedtype: enhancementA general enhancementA general enhancementand removedstatus: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on
on Oct 3, 2025 Historically
RestTemplateexposed low level streaming viaInputStreamandOutputStream. ForWebClient, with Reactive Streams (error/completion/cancel/demand signals) and a functional,java.util.stream-like API, it was natural natural to provide higher level streaming.RestClientpicks up from whereRestTemplatewas.How to consume an SSE stream is a key question. Historically, an API of this kind is callback-based to avoid blocking. In the JDK, the
HttpClienthasHttpResponse.BodyHandler(essentially Reactive StreamsFlow.Subscriber) including one that splits the response by line. We need the Loom friendly equivalent.In modern Java with Loom, it's natural to use a pull-style API that blocks, and integrates well with Structured Concurrency for responsiveness to cancellation. A basic version with rendezvous hand-off is straight-forward enough, but a more advanced version that supports prefetching raises plenty of questions. An even more advanced, functional API, is even more ambitious.
There is currently nothing in the JDK for this, and it's not going to come soon (e.g. see Structured Concurrency [JEP 505](https://openjdk.org/jeps/505, which lists "sharing streams of data among threads" as a non-goal). We need to explore alternatives in the mean time.
I am very upset that there is no SSE support in SpringBoot, my current projects do not allow updating SpringBoot 4, so the upgrade process has stopped. Please add your work with SSE.
@pro-peller I don't understand the link with Spring Boot 4. Why can't you upgrade to Spring Boot 4 and why is that about SSE support in RestClient?
Spring Boot 4 lacks SSE support, blocking our upgrade path. Our applications depend on Server-Sent Events, so we can't migrate until this feature is available. Please add SSE support to Spring Boot 4
@axma331 I think there is a misunderstanding here. Spring Boot 4 does support SSE and all features that are available in Spring Boot 3. So upgrading is definitely possible for your apps.
This issue is about a brand new feature that never existed so far. We are exploring different approaches because the JDK is missing infrastructure for streaming support.
So again: there is no blocker for the Spring Boot 4 upgrade. I'm not sure what lead you to think that.
Reacted by Ilia Beliaev- added a commit that references this issue
on Sep 19, 2026 @hojooo thanks for the proposal. We've got an advanced prototype and we're experimenting with it. We'll communicate more broadly when it's ready to get community feedback. I'll mark the issue as blocked so that the community doesn't spend time on this.
Reacted by hojooo- addedstatus: blockedAn issue that's blocked on an external project changeAn issue that's blocked on an external project change
on Oct 8, 2026
In Spring WebClient is the only supported way to consume SSE streams. However, using WebClient introduce a reactive streams increasing application complexity.
Ideally RestClient can support the consumption of SSE streams allowing developers to keep codebases simple.
Spring offers reactive and non-reactive facilities for producing SSE events. Adding the ability to consume SSE streams in a reactive and non-reactive ways bring the server side and client side experience to parity.