August 2018
Intermediate to advanced
372 pages
9h 29m
English
Reactive REST services have been added by using WebFlux as a part of the Spring web stack. This allows us to implement endpoints that are capable of delivering information as streams.
Let's review how this works from a practical viewpoint. Suppose that you want to retrieve notifications that are often pushed by users. Without using the reactive approach, you can retrieve all of the notifications created until the request is made; but, with the reactive approach, you can keep receiving new notifications, which means that if a new notification is created, you will receive it at that exact moment. Let's analyze the following code snippet:
@GetMapping(value = "/{singer}/comments", produces = MediaType.TEXT_EVENT_STREAM_VALUE ...Read now
Unlock full access