From the course: Complete Guide to Spring MVC

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

HTTP streaming overview

HTTP streaming overview

- [Instructor] HTTP Streaming overview. HTTP Streaming is a server side technique that allows sending data to clients incrementally as it becomes available rather than waiting for the entire response to be generated. This is useful for real-time updates, large datasets and long-running task. HTTP streaming mechanisms in Spring MVC include ResponseBodyEmitter, SseEmitter and StreamingResponseBody. This lesson, we'll go over all three of these. ResponseBodyEmitter. In this example here, we have a Spring MVC controller method that is demonstrating the use of ResponseBodyEmitter to asynchronously send multiple events or data chunks to the client over time. It is designed to handle scenarios where data is produced incrementally or needs to be sent in real time updates. So the ResponseBodyEmitter is returned from the controller and it creates a ResponseBody instance. And the purpose of this is that the object acts as a bridge to stream data to the client without waiting for the entire…

Contents