intermediateSpring AI — Tool Calling, Agents & Production
How do you implement streaming Server-Sent Events (SSE) with Spring AI in a REST controller?
Return a Flux<String> from a controller method with produces = MediaType.TEXT_EVENT_STREAM_VALUE, backed by chatClient.prompt().user(message).stream().content() — Spring auto-configures SSE from the Flux return type, and the browser receives tokens as they're generated.
This is a Pro question
Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.
How do you implement streaming Server-Sent Events (SSE) with Spring AI in a REST controller?