BAEL-2302 UPDATED Spring Data REST HTTP Method customization example (#5594)

* BAEL-2302 Spring Data REST HTTP Method customization example

* BAEL-2302 Spring Data REST - granular HTTP Methods control

* BAEL-2302 Spring Data REST - fixed parent pom file version error

* BAEL-2302 Fixing thymeleaf dependencies

* BAEL-2302 Spring Data REST - fixed netty bootstrap

* BAEL-2302 Spring Data REST - fixed netty test

* BAEL-2302 Spring Data REST - fixed spring security oauth2

* BAEL-2302 - Fix oauth2 server deps
This commit is contained in:
gmconte
2018-11-10 05:26:28 +00:00
committed by KevinGilmore
parent 2d872af165
commit 52852b3a49
15 changed files with 95 additions and 65 deletions

View File

@@ -8,8 +8,8 @@ import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
import reactor.ipc.netty.NettyContext;
import reactor.ipc.netty.http.server.HttpServer;
import reactor.netty.DisposableServer;
import reactor.netty.http.server.HttpServer;
@ComponentScan(basePackages = {"com.baeldung.reactive.security"})
@EnableWebFlux
@@ -18,17 +18,16 @@ public class SpringSecurity5Application {
public static void main(String[] args) {
try (AnnotationConfigApplicationContext context =
new AnnotationConfigApplicationContext(SpringSecurity5Application.class)) {
context.getBean(NettyContext.class).onClose().block();
context.getBean(DisposableServer.class).onDispose().block();
}
}
@Bean
public NettyContext nettyContext(ApplicationContext context) {
public DisposableServer nettyContext(ApplicationContext context) {
HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context)
.build();
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
HttpServer httpServer = HttpServer.create("localhost", 8080);
return httpServer.newHandler(adapter).block();
return HttpServer.create().host("localhost").port(8080).handle(adapter).bind().block();
}
}