The Spring team has introduced stream-source, a new experimental Java library designed to make streaming data work naturally with virtual threads. Announced on the Spring blog on 1 December 2026 by Spring Framework engineer Rossen Stoyanchev, the project aims to fill a gap that has opened up as more Java developers adopt Project Loom instead of reactive programming.
Why a new library
Virtual threads, introduced through JEP 444, let developers write simple blocking code that still scales. According to the announcement, however, there is still no simple, standard model for consuming streaming sources on that stack. Examples include server-sent events, token-by-token output from large language models and responses from Model Context Protocol servers. The post argues that push-style callback handlers are easy to get wrong: if a handler blocks, it stalls the producer, and workarounds that hand work to dedicated threads add complexity.
A pull-based model
Stream-source takes the opposite approach. Instead of reacting to callbacks, consumers pull items in a loop, typically inside a try-with-resources block so that resources are released automatically when the loop ends. The central abstraction is called Source, and producers usually extend a base class to implement it. Sources can be wrapped with decorators to add behaviour.
For cases where producer and consumer run on different threads, the library offers an Exchange type with a sink side and a source side, connected by a blocking queue. That queue provides natural backpressure when the two sides work at different speeds. A SourceTask helper can run a producer in the background while the consumer reads, and adapters connect stream-source to existing Reactive Streams code, including the JDK HTTP client.
Small and independent
Although it was built by the Spring team, the library does not depend on Spring. Its only dependencies are JSpecify and SLF4J, and the blog describes it as a low-level building block comparable in scope to Micrometer or Reactor. It requires Java 17 as a baseline and uses virtual threads by default on Java 21 and later. The current release is version 0.8.0, and the code lives in the spring-projects-experimental organisation on GitHub.
Roadmap
According to the announcement, a milestone phase will start in early 2027, with a 1.0 general availability release planned for May 2027. Spring AI 3.0 and the MCP Java SDK both intend to build their streaming APIs on stream-source, with their own GA releases also aimed at May 2027. Spring Framework 7.2, planned for November 2027, is expected to add support, and experimental server-sent events support for RestClient is already available in a separate extensions repository. A follow-up Spring AI post was scheduled for 3 December.
A stopgap for the JDK
The post is candid that stream-source exists partly because Java lacks a standard channel abstraction. If the JDK eventually adopts a channels proposal, the library will adapt to it. Until then, the Spring team is inviting developers to try the project and give feedback through its issue trackers.
Sources:

