Skip to main content

Mini Project: Asynchronous Requests: Callable, DeferredResult and Server-Sent Events

Learn Mini Project: Asynchronous Requests: Callable, DeferredResult and Server-Sent Events (Advanced Spring MVC, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Asynchronous Requests: Callable, DeferredResult and Server-Sent Events Problem Some requests wait for something slow (a report, a payment provider, a message). Holding a server thread the whole time wastes capacity. Spring MVC can release the thread and finish the response later, or stream events to the browser. Requirements Return a Callable so the work runs on another thread. Return a DeferredResult completed later by a different thread. Handle a timeout. Stream events with SseEmitter. Show the request is "async started" before the result exists. Concepts Used...

More lessons in Advanced Spring MVC