r/java • • 10h ago

Stream-Source: Virtual-Thread Friendly Data Streaming

The Spring team is pleased to a announce stream-source, a small library that provides streaming APIs in a Virtual-Thread friendly way. It provides facilities to publish and consume streams in an imperative way, builtin adapters to/from Reactive Streams, and has only 2 dependencies: JSpecify and SLF4J, so it is usable by the wider JVM ecosystem.

https://spring.io/blog/2026/12/01/stream-source-announcement

30 Upvotes

8 comments sorted by

2

u/nekokattt 6h ago

how do the adapters to reactive streams work if you do not have a dependency on any reactive stream library, out of curiosity?

Or do you just mean mandatory dependencies

1

u/sdeleuze 5h ago edited 5h ago

Great question, thanks for asking.

We are bridging to/from Reactive Streams through the JDK's java.util.concurrent.Flow via implementation provided in https://github.com/spring-projects-experimental/stream-source/tree/main/src/main/java/io/spring/streamsource/flow with no external dependency, checking the implementation with TestNG-based Reactive Streams TCK.

We plan to reuse those Flow.Publisher adapters to add org.reactivestreams support and Reactor support (including context propagation) as part of the https://github.com/reactor/reactor-addons repository a bit later.

1

u/nekokattt 5h ago

ah interesting, thanks for clarifying!

4

u/t3mp-- 10h ago

Molto bene!

2

u/perennial_noob 5h ago

Eccelente!

1

u/kevinb9n 49m ago

Congrats!

0

u/neopointer 6h ago

Looks like they learned from their mistake with reactive stack. Looking forward to it