Summary
Add a reactive streaming interface using Project Reactor (Mono/Flux) for the Java SDK's WebSocket clients, enabling non-blocking, backpressure-aware audio streaming and transcript consumption that integrates naturally with Spring WebFlux and other reactive Java frameworks.
Problem it solves
Modern Java applications increasingly use reactive programming (Spring WebFlux, Vert.x, Micronaut) for high-throughput, non-blocking I/O. The current Java SDK uses callback-based patterns that don't compose well with reactive pipelines. Developers building reactive applications must wrap Deepgram's callbacks in custom Flux/Mono adapters, handle backpressure manually, and bridge between reactive and imperative code. A native reactive interface lets developers use Deepgram's streaming APIs as natural elements in their reactive data pipelines — subscribing to transcript streams with operators like map, filter, buffer, and flatMap.
Proposed API
import com.deepgram.sdk.reactive.ReactiveDeepgramClient;
import reactor.core.publisher.Flux;
ReactiveDeepgramClient client = ReactiveDeepgramClient.create(apiKey);
// Streaming STT as a Flux
Flux<TranscriptResult> transcripts = client.listen()
.model("nova-3")
.language("en")
.streamFrom(audioFlux) // Flux<byte[]> of audio chunks
.filter(result -> result.isFinal())
.map(result -> result.getTranscript());
// Subscribe with backpressure
transcripts
.bufferTimeout(10, Duration.ofSeconds(5))
.flatMap(batch -> saveToDatabase(batch))
.subscribe();
// TTS as a Flux of audio chunks
Flux<byte[]> audioStream = client.speak()
.model("aura-asteria-en")
.text("Hello from Deepgram")
.stream();
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add a reactive streaming interface using Project Reactor (Mono/Flux) for the Java SDK's WebSocket clients, enabling non-blocking, backpressure-aware audio streaming and transcript consumption that integrates naturally with Spring WebFlux and other reactive Java frameworks.
Problem it solves
Modern Java applications increasingly use reactive programming (Spring WebFlux, Vert.x, Micronaut) for high-throughput, non-blocking I/O. The current Java SDK uses callback-based patterns that don't compose well with reactive pipelines. Developers building reactive applications must wrap Deepgram's callbacks in custom Flux/Mono adapters, handle backpressure manually, and bridge between reactive and imperative code. A native reactive interface lets developers use Deepgram's streaming APIs as natural elements in their reactive data pipelines — subscribing to transcript streams with operators like map, filter, buffer, and flatMap.
Proposed API
Acceptance criteria
Raised by the DX intelligence system.