Commit for Eval Article pull request

This commit is contained in:
smokeyrobot
2018-05-02 00:18:41 -04:00
committed by Kyle Doyle
parent e3978a5f95
commit c23ac47178
5 changed files with 128 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package com.baeldung.reactive.kdoyle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;
@Component
public class RealTimeTest {
@Autowired
WebClient client;
public void read(){
client.get().uri("/read")
.accept(MediaType.TEXT_EVENT_STREAM)
.retrieve()
.bodyToFlux(ReadingBook.class)
.subscribe(System.out::println);
}
}