Commit for Eval Article pull request
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user