Delete ReactiveEventClient.java

This commit is contained in:
micropatel 2018-07-09 19:30:46 -03:00 committed by GitHub
parent 03c5e4c03a
commit 733f3f50c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 29 deletions

View File

@ -1,29 +0,0 @@
package com.baeldung.reactive;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
@SpringBootApplication
public class ReactiveEventClient implements CommandLineRunner {
public static void main(String[] args) {
System.setProperty("server.port","8090");
SpringApplication.run(ReactiveEventClient.class, args);
}
@Override
public void run(String... args) throws Exception {
WebClient webclient = WebClient.builder()
.defaultHeader(HttpHeaders.ACCEPT, MediaType.TEXT_EVENT_STREAM_VALUE)
.baseUrl("http://localhost:8080/events")
.build();
webclient.get().uri("/stream/").header(HttpHeaders.CONTENT_TYPE,MediaType.TEXT_HTML.toString())
.retrieve().bodyToFlux(String.class)
.subscribe(System.out::println);
}
}