From c30b23a1408a16082ed404d6cf05e90ffe4f1af7 Mon Sep 17 00:00:00 2001 From: timis1 <12120641+timis1@users.noreply.github.com> Date: Tue, 17 Oct 2023 06:30:29 +0300 Subject: [PATCH] JAVA-24463 Cleanup spring-reactive-modules (#14989) * JAVA-24463 Renaming spring-data-couchbase into spring-reactive-data-couchbase * JAVA-24463 Moving spring boot actuator from spring reactive security to spring reactive 3 * JAVA-24463 Migrating URL matching and set header on response from spring-5 reactive to spring reactive-2 * JAVA-24463 Migrating reactive websocket and session reactive support to spring-reactive-3 --------- Co-authored-by: timis1 --- spring-reactive-modules/pom.xml | 6 +- .../spring-5-reactive/.gitignore | 12 -- .../spring-5-reactive/README.md | 14 -- .../spring-5-reactive/pom.xml | 164 ------------------ .../src/main/assets/index.html | 10 -- .../configuration/WebFluxSecurityConfig.java | 56 ------ .../src/main/resources/application.properties | 2 - .../spring-reactive-2/README.md | 2 + .../spring-reactive-2/pom.xml | 4 + .../reactive/Spring5ReactiveApplication.java | 0 .../controller/FooReactiveController.java | 0 .../controller/PathPatternController.java | 0 .../java/com/baeldung/reactive/model/Foo.java | 0 .../controllers/ResponseHeaderController.java | 0 .../filter/AddResponseHeaderWebFilter.java | 0 .../handlers/ResponseHeaderHandler.java | 0 .../ResponseHeadersRouterFunctions.java | 0 .../com/baeldung/reactive/urlmatch/Actor.java | 0 ...Spring5URLPatternUsingRouterFunctions.java | 2 +- .../reactive/urlmatch/FormHandler.java | 0 .../urlmatch/FunctionalWebApplication.java | 0 .../reactive/urlmatch/IndexRewriteFilter.java | 0 .../com/baeldung/reactive/util/CpuUtils.java | 0 .../src/main/resources/files/hello.txt | 0 .../src/main/resources/files/test/test.txt | 0 .../main/resources/resources/test/test.txt | 0 .../com/baeldung/reactive/FluxUnitTest.java | 0 .../ResponseHeaderLiveTest.java | 0 ...rnUsingRouterFunctionsIntegrationTest.java | 0 ...ernsUsingHandlerMethodIntegrationTest.java | 0 .../spring-reactive-3/README.md | 3 + .../spring-reactive-3/pom.xml | 16 ++ .../src/main/WEB-INF/web.xml | 0 .../java/com/baeldung/functional/Actor.java | 0 .../com/baeldung/functional/FormHandler.java | 0 .../FunctionalSpringBootApplication.java | 0 .../functional/FunctionalWebApplication.java | 0 .../functional/IndexRewriteFilter.java | 0 .../com/baeldung/functional/RootServlet.java | 0 .../DownstreamServiceHealthIndicator.java | 0 .../reactive/actuator/FeaturesEndpoint.java | 0 .../actuator/InfoWebEndpointExtension.java | 0 .../actuator/Spring5ReactiveApplication.java | 2 + .../com/baeldung/websession/Application.java | 0 .../websession/configuration/RedisConfig.java | 0 .../configuration/SessionConfig.java | 0 .../configuration/WebFluxConfig.java | 1 - .../controller/SessionController.java | 0 .../websession/transfer/CustomResponse.java | 0 .../java/com/baeldung/websocket/Event.java | 0 .../ReactiveJavaClientWebSocket.java | 0 .../ReactiveWebSocketApplication.java | 0 .../ReactiveWebSocketConfiguration.java | 0 .../websocket/ReactiveWebSocketHandler.java | 0 .../websocket/WebSocketController.java | 0 .../src/main/resources/application.properties | 14 +- .../src/main/resources/files/hello.txt | 1 + .../src/main/resources/logback.xml | 0 .../resources/static/client-websocket.html | 0 .../java/com/baeldung/SpringContextTest.java | 4 +- ...nctionalWebApplicationIntegrationTest.java | 0 .../actuator/ActuatorInfoIntegrationTest.java | 6 +- .../src/test/resources/baeldung-weekly.png | Bin .../README.md | 0 .../pom.xml | 2 +- .../ReactiveCouchbaseApplication.java | 0 .../configuration/CouchbaseProperties.java | 0 .../N1QLReactiveCouchbaseConfiguration.java | 0 .../ReactiveCouchbaseConfiguration.java | 0 .../ViewReactiveCouchbaseConfiguration.java | 0 .../com/baeldung/couchbase/domain/Person.java | 0 .../repository/n1ql/N1QLPersonRepository.java | 0 .../n1ql/N1QLSortingPersonRepository.java | 0 .../repository/view/ViewPersonRepository.java | 0 .../src/main/resources/couchbase.properties | 0 .../src/main/resources/logback.xml | 0 .../CouchbaseMockConfiguration.java | 0 .../n1ql/N1QLPersonRepositoryLiveTest.java | 0 .../N1QLSortingPersonRepositoryLiveTest.java | 0 .../ViewPersonRepositoryIntegrationTest.java | 0 .../spring-reactive-security/README.md | 1 - .../spring-reactive-security/pom.xml | 4 - .../reactive/actuator/WebSecurityConfig.java | 23 --- .../java/com/baeldung/SpringContextTest.java | 5 +- 84 files changed, 51 insertions(+), 303 deletions(-) delete mode 100644 spring-reactive-modules/spring-5-reactive/.gitignore delete mode 100644 spring-reactive-modules/spring-5-reactive/README.md delete mode 100644 spring-reactive-modules/spring-5-reactive/pom.xml delete mode 100644 spring-reactive-modules/spring-5-reactive/src/main/assets/index.html delete mode 100644 spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java delete mode 100644 spring-reactive-modules/spring-5-reactive/src/main/resources/application.properties rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/controller/FooReactiveController.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/controller/PathPatternController.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/model/Foo.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/responseheaders/controllers/ResponseHeaderController.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/responseheaders/filter/AddResponseHeaderWebFilter.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/responseheaders/functional/handlers/ResponseHeaderHandler.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/responseheaders/functional/routers/ResponseHeadersRouterFunctions.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/urlmatch/Actor.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java (98%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/urlmatch/FormHandler.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/urlmatch/FunctionalWebApplication.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/urlmatch/IndexRewriteFilter.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/java/com/baeldung/reactive/util/CpuUtils.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/resources/files/hello.txt (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/resources/files/test/test.txt (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/main/resources/resources/test/test.txt (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/test/java/com/baeldung/reactive/FluxUnitTest.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/test/java/com/baeldung/reactive/responseheaders/ResponseHeaderLiveTest.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/test/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-2}/src/test/java/com/baeldung/reactive/urlmatch/PathPatternsUsingHandlerMethodIntegrationTest.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/WEB-INF/web.xml (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/Actor.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/FormHandler.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/FunctionalSpringBootApplication.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/FunctionalWebApplication.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/IndexRewriteFilter.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/functional/RootServlet.java (100%) rename spring-reactive-modules/{spring-reactive-security => spring-reactive-3}/src/main/java/com/baeldung/reactive/actuator/DownstreamServiceHealthIndicator.java (100%) rename spring-reactive-modules/{spring-reactive-security => spring-reactive-3}/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java (100%) rename spring-reactive-modules/{spring-reactive-security => spring-reactive-3}/src/main/java/com/baeldung/reactive/actuator/InfoWebEndpointExtension.java (100%) rename spring-reactive-modules/{spring-reactive-security => spring-reactive-3}/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java (73%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/Application.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/configuration/RedisConfig.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/configuration/SessionConfig.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java (89%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/controller/SessionController.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websession/transfer/CustomResponse.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/Event.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/ReactiveJavaClientWebSocket.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/ReactiveWebSocketApplication.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/ReactiveWebSocketConfiguration.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/ReactiveWebSocketHandler.java (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/java/com/baeldung/websocket/WebSocketController.java (100%) create mode 100644 spring-reactive-modules/spring-reactive-3/src/main/resources/files/hello.txt rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/resources/logback.xml (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/main/resources/static/client-websocket.html (100%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/test/java/com/baeldung/SpringContextTest.java (75%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java (100%) rename spring-reactive-modules/{spring-reactive-security => spring-reactive-3}/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java (87%) rename spring-reactive-modules/{spring-5-reactive => spring-reactive-3}/src/test/resources/baeldung-weekly.png (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/README.md (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/pom.xml (98%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/ReactiveCouchbaseApplication.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/configuration/CouchbaseProperties.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/configuration/N1QLReactiveCouchbaseConfiguration.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/configuration/ViewReactiveCouchbaseConfiguration.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/domain/Person.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepository.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepository.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/resources/couchbase.properties (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/main/resources/logback.xml (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/test/java/com/baeldung/couchbase/domain/repository/CouchbaseMockConfiguration.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepositoryLiveTest.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepositoryLiveTest.java (100%) rename spring-reactive-modules/{spring-data-couchbase => spring-reactive-data-couchbase}/src/test/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepositoryIntegrationTest.java (100%) delete mode 100644 spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java diff --git a/spring-reactive-modules/pom.xml b/spring-reactive-modules/pom.xml index 06519d723a..dd827d796e 100644 --- a/spring-reactive-modules/pom.xml +++ b/spring-reactive-modules/pom.xml @@ -19,7 +19,6 @@ spring-reactive-data spring-reactive-data-2 - spring-5-reactive spring-reactive-2 spring-reactive-3 spring-reactive-client @@ -27,7 +26,7 @@ spring-reactive-filters spring-reactive-oauth spring-reactive-security - spring-data-couchbase + spring-reactive-data-couchbase spring-reactive spring-reactive-exceptions spring-reactor @@ -64,7 +63,4 @@ - - - \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/.gitignore b/spring-reactive-modules/spring-5-reactive/.gitignore deleted file mode 100644 index dec013dfa4..0000000000 --- a/spring-reactive-modules/spring-5-reactive/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -#folders# -.idea -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/README.md b/spring-reactive-modules/spring-5-reactive/README.md deleted file mode 100644 index 3f44267234..0000000000 --- a/spring-reactive-modules/spring-5-reactive/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Spring 5 Reactive Project - -This module contains articles about reactive Spring Boot - -### The Course -The "REST With Spring" Classes: https://bit.ly/restwithspring - -### Relevant Articles - -- [Exploring the Spring 5 WebFlux URL Matching](https://www.baeldung.com/spring-5-mvc-url-matching) -- [Reactive WebSockets with Spring 5](https://www.baeldung.com/spring-5-reactive-websockets) -- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) -- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) -- More articles: [[next -->]](../spring-5-reactive-2) \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/pom.xml b/spring-reactive-modules/spring-5-reactive/pom.xml deleted file mode 100644 index fd47c70a07..0000000000 --- a/spring-reactive-modules/spring-5-reactive/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - 4.0.0 - spring-5-reactive - 0.0.1-SNAPSHOT - spring-5-reactive - jar - spring 5 sample project about new features - - - com.baeldung.spring.reactive - spring-reactive-modules - 1.0.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-integration - - - org.springframework.boot - spring-boot-starter-websocket - - - javax.json.bind - javax.json.bind-api - - - org.projectlombok - lombok - compile - - - org.apache.geronimo.specs - geronimo-json_1.1_spec - ${geronimo-json_1.1_spec.version} - - - org.apache.johnzon - johnzon-jsonb - - - - org.apache.commons - commons-lang3 - - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework - spring-test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - io.projectreactor - reactor-test - test - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.boot - spring-boot-starter-data-redis - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.session - spring-session-core - - - org.springframework.session - spring-session-data-redis - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - test - - - io.reactivex.rxjava2 - rxjava - - - org.apache.httpcomponents - httpclient - - - io.netty - netty-all - - - - - - - maven-resources-plugin - 3.0.1 - - - copy-resources - validate - - copy-resources - - - - - src/main/assets - true - - - ${basedir}/target/classes/assets - - - - - - org.springframework.boot - spring-boot-maven-plugin - - com.baeldung.reactive.Spring5ReactiveApplication - JAR - - - - - - - 1.1.3 - 1.0 - 1.0 - - - \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/src/main/assets/index.html b/spring-reactive-modules/spring-5-reactive/src/main/assets/index.html deleted file mode 100644 index 047514df1c..0000000000 --- a/spring-reactive-modules/spring-5-reactive/src/main/assets/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Baeldung: Static Content in Spring WebFlux - - -Example Spring Web Flux and web resources configuration - - \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java b/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java deleted file mode 100644 index 61927e47ab..0000000000 --- a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.baeldung.websession.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; -import org.springframework.security.config.web.server.ServerHttpSecurity; -import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.web.server.SecurityWebFilterChain; -import org.springframework.security.web.server.context.WebSessionServerSecurityContextRepository; - -@Configuration -@EnableWebFluxSecurity -public class WebFluxSecurityConfig { - - @Bean - public MapReactiveUserDetailsService userDetailsService() { - UserDetails admin = User - .withUsername("admin") - .password(encoder().encode("password")) - .roles("ADMIN") - .build(); - - UserDetails user = User - .withUsername("user") - .password(encoder().encode("password")) - .roles("USER") - .build(); - - return new MapReactiveUserDetailsService(admin, user); - } - - @Bean - public SecurityWebFilterChain webSessionSpringSecurityFilterChain(ServerHttpSecurity http) { - http.authorizeExchange() - .anyExchange().authenticated() - .and() - .httpBasic() - .securityContextRepository(new WebSessionServerSecurityContextRepository()) - .and() - .formLogin(); - - http.csrf().disable(); - - return http.build(); - - } - - @Bean - public PasswordEncoder encoder() { - return new BCryptPasswordEncoder(); - } -} diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/application.properties b/spring-reactive-modules/spring-5-reactive/src/main/resources/application.properties deleted file mode 100644 index dfe4a4d994..0000000000 --- a/spring-reactive-modules/spring-5-reactive/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -logging.level.root=INFO -server.tomcat.max-keep-alive-requests=1 \ No newline at end of file diff --git a/spring-reactive-modules/spring-reactive-2/README.md b/spring-reactive-modules/spring-reactive-2/README.md index a5df5187bf..a6a4c4f5d0 100644 --- a/spring-reactive-modules/spring-reactive-2/README.md +++ b/spring-reactive-modules/spring-reactive-2/README.md @@ -7,4 +7,6 @@ This module contains articles about reactive Spring Boot. - [Static Content in Spring WebFlux](https://www.baeldung.com/spring-webflux-static-content) - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - [Backpressure Mechanism in Spring WebFlux](https://www.baeldung.com/spring-webflux-backpressure) +- [Exploring the Spring 5 WebFlux URL Matching](https://www.baeldung.com/spring-5-mvc-url-matching) +- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) - More articles: [[<-- prev]](../spring-5-reactive) [[next -->]](../spring-5-reactive-3) diff --git a/spring-reactive-modules/spring-reactive-2/pom.xml b/spring-reactive-modules/spring-reactive-2/pom.xml index ba40f3b48a..13970851cd 100644 --- a/spring-reactive-modules/spring-reactive-2/pom.xml +++ b/spring-reactive-modules/spring-reactive-2/pom.xml @@ -59,6 +59,10 @@ spring-security-test test + + org.springframework.boot + spring-boot-starter-tomcat + diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/FooReactiveController.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/controller/FooReactiveController.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/FooReactiveController.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/controller/FooReactiveController.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/PathPatternController.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/controller/PathPatternController.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/PathPatternController.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/controller/PathPatternController.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/model/Foo.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/model/Foo.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/model/Foo.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/model/Foo.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/controllers/ResponseHeaderController.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/controllers/ResponseHeaderController.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/controllers/ResponseHeaderController.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/controllers/ResponseHeaderController.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/filter/AddResponseHeaderWebFilter.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/filter/AddResponseHeaderWebFilter.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/filter/AddResponseHeaderWebFilter.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/filter/AddResponseHeaderWebFilter.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/functional/handlers/ResponseHeaderHandler.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/functional/handlers/ResponseHeaderHandler.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/functional/handlers/ResponseHeaderHandler.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/functional/handlers/ResponseHeaderHandler.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/functional/routers/ResponseHeadersRouterFunctions.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/functional/routers/ResponseHeadersRouterFunctions.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/responseheaders/functional/routers/ResponseHeadersRouterFunctions.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/responseheaders/functional/routers/ResponseHeadersRouterFunctions.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/Actor.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/Actor.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/Actor.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/Actor.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java similarity index 98% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java index b7bb53600e..6007597220 100644 --- a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java +++ b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctions.java @@ -32,7 +32,7 @@ public class ExploreSpring5URLPatternUsingRouterFunctions { .and(RouterFunctions.resources("/resources/**", new ClassPathResource("resources/"))); } - WebServer start() throws Exception { + WebServer start() { WebHandler webHandler = (WebHandler) toHttpHandler(routingFunction()); HttpHandler httpHandler = WebHttpHandlerBuilder.webHandler(webHandler) .filter(new IndexRewriteFilter()) diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/FormHandler.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/FormHandler.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/FormHandler.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/FormHandler.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/FunctionalWebApplication.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/FunctionalWebApplication.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/FunctionalWebApplication.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/FunctionalWebApplication.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/IndexRewriteFilter.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/IndexRewriteFilter.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/urlmatch/IndexRewriteFilter.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/urlmatch/IndexRewriteFilter.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/util/CpuUtils.java b/spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/util/CpuUtils.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/reactive/util/CpuUtils.java rename to spring-reactive-modules/spring-reactive-2/src/main/java/com/baeldung/reactive/util/CpuUtils.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/files/hello.txt b/spring-reactive-modules/spring-reactive-2/src/main/resources/files/hello.txt similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/resources/files/hello.txt rename to spring-reactive-modules/spring-reactive-2/src/main/resources/files/hello.txt diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/files/test/test.txt b/spring-reactive-modules/spring-reactive-2/src/main/resources/files/test/test.txt similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/resources/files/test/test.txt rename to spring-reactive-modules/spring-reactive-2/src/main/resources/files/test/test.txt diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/resources/test/test.txt b/spring-reactive-modules/spring-reactive-2/src/main/resources/resources/test/test.txt similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/resources/resources/test/test.txt rename to spring-reactive-modules/spring-reactive-2/src/main/resources/resources/test/test.txt diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/FluxUnitTest.java b/spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/FluxUnitTest.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/FluxUnitTest.java rename to spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/FluxUnitTest.java diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/responseheaders/ResponseHeaderLiveTest.java b/spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/responseheaders/ResponseHeaderLiveTest.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/responseheaders/ResponseHeaderLiveTest.java rename to spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/responseheaders/ResponseHeaderLiveTest.java diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest.java b/spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest.java rename to spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/urlmatch/ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest.java diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/urlmatch/PathPatternsUsingHandlerMethodIntegrationTest.java b/spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/urlmatch/PathPatternsUsingHandlerMethodIntegrationTest.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/reactive/urlmatch/PathPatternsUsingHandlerMethodIntegrationTest.java rename to spring-reactive-modules/spring-reactive-2/src/test/java/com/baeldung/reactive/urlmatch/PathPatternsUsingHandlerMethodIntegrationTest.java diff --git a/spring-reactive-modules/spring-reactive-3/README.md b/spring-reactive-modules/spring-reactive-3/README.md index 640a60d63d..631763fa59 100644 --- a/spring-reactive-modules/spring-reactive-3/README.md +++ b/spring-reactive-modules/spring-reactive-3/README.md @@ -5,4 +5,7 @@ This module contains articles about reactive Spring Boot. - [Logging a Reactive Sequence](https://www.baeldung.com/spring-reactive-sequence-logging) - [Reading Flux Into a Single InputStream Using Spring Reactive WebClient](https://www.baeldung.com/spring-reactive-read-flux-into-inputstream) - [Cancel an Ongoing Flux in Spring WebFlux](https://www.baeldung.com/spring-webflux-cancel-flux) +- [Spring Boot Actuator](https://www.baeldung.com/spring-boot-actuators) +- [Reactive WebSockets with Spring 5](https://www.baeldung.com/spring-5-reactive-websockets) +- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - More articles: [[<-- prev]](../spring-5-reactive-2) diff --git a/spring-reactive-modules/spring-reactive-3/pom.xml b/spring-reactive-modules/spring-reactive-3/pom.xml index 7672fa29f3..96f23f1339 100644 --- a/spring-reactive-modules/spring-reactive-3/pom.xml +++ b/spring-reactive-modules/spring-reactive-3/pom.xml @@ -47,6 +47,22 @@ org.projectlombok lombok + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.session + spring-session-core + + + org.springframework.session + spring-session-data-redis + diff --git a/spring-reactive-modules/spring-5-reactive/src/main/WEB-INF/web.xml b/spring-reactive-modules/spring-reactive-3/src/main/WEB-INF/web.xml similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/WEB-INF/web.xml rename to spring-reactive-modules/spring-reactive-3/src/main/WEB-INF/web.xml diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/Actor.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/Actor.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/Actor.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/Actor.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FormHandler.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FormHandler.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FormHandler.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FormHandler.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FunctionalSpringBootApplication.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FunctionalSpringBootApplication.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FunctionalSpringBootApplication.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FunctionalSpringBootApplication.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FunctionalWebApplication.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FunctionalWebApplication.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/FunctionalWebApplication.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/FunctionalWebApplication.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/IndexRewriteFilter.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/IndexRewriteFilter.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/IndexRewriteFilter.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/IndexRewriteFilter.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/RootServlet.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/RootServlet.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/functional/RootServlet.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/functional/RootServlet.java diff --git a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/DownstreamServiceHealthIndicator.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/DownstreamServiceHealthIndicator.java similarity index 100% rename from spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/DownstreamServiceHealthIndicator.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/DownstreamServiceHealthIndicator.java diff --git a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java similarity index 100% rename from spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java diff --git a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/InfoWebEndpointExtension.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/InfoWebEndpointExtension.java similarity index 100% rename from spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/InfoWebEndpointExtension.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/InfoWebEndpointExtension.java diff --git a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java similarity index 73% rename from spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java index 600bff5948..19b83ee651 100644 --- a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java +++ b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java @@ -2,8 +2,10 @@ package com.baeldung.reactive.actuator; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; @SpringBootApplication +@ComponentScan(basePackages = "com.baeldung.reactive.actuator") public class Spring5ReactiveApplication { public static void main(String[] args) { diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/Application.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/Application.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/Application.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/Application.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/RedisConfig.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/RedisConfig.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/SessionConfig.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/SessionConfig.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java similarity index 89% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java index 964b544916..041c37e7fc 100644 --- a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java +++ b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java @@ -4,7 +4,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Configuration; import org.springframework.web.reactive.config.EnableWebFlux; -import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; @Configuration diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/controller/SessionController.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/controller/SessionController.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/transfer/CustomResponse.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websession/transfer/CustomResponse.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/Event.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/Event.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/Event.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/Event.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveJavaClientWebSocket.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveJavaClientWebSocket.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveJavaClientWebSocket.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveJavaClientWebSocket.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketApplication.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketApplication.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketApplication.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketApplication.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketConfiguration.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketConfiguration.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketConfiguration.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketConfiguration.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketHandler.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketHandler.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/ReactiveWebSocketHandler.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/ReactiveWebSocketHandler.java diff --git a/spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/WebSocketController.java b/spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/WebSocketController.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/java/com/baeldung/websocket/WebSocketController.java rename to spring-reactive-modules/spring-reactive-3/src/main/java/com/baeldung/websocket/WebSocketController.java diff --git a/spring-reactive-modules/spring-reactive-3/src/main/resources/application.properties b/spring-reactive-modules/spring-reactive-3/src/main/resources/application.properties index 815cc2b76d..767f8106dd 100644 --- a/spring-reactive-modules/spring-reactive-3/src/main/resources/application.properties +++ b/spring-reactive-modules/spring-reactive-3/src/main/resources/application.properties @@ -1 +1,13 @@ -# application properties \ No newline at end of file +# application properties +management.endpoints.web.exposure.include=* + +info.app.name=Spring Boot 2 actuator Application +management.endpoint.health.group.custom.include=diskSpace,ping +management.endpoint.health.group.custom.show-components=always +management.endpoint.health.group.custom.show-details=always +management.endpoint.health.group.custom.status.http-mapping.up=207 + +spring.main.allow-bean-definition-overriding=true + +logging.level.root=INFO +server.tomcat.max-keep-alive-requests=1 \ No newline at end of file diff --git a/spring-reactive-modules/spring-reactive-3/src/main/resources/files/hello.txt b/spring-reactive-modules/spring-reactive-3/src/main/resources/files/hello.txt new file mode 100644 index 0000000000..b6fc4c620b --- /dev/null +++ b/spring-reactive-modules/spring-reactive-3/src/main/resources/files/hello.txt @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/logback.xml b/spring-reactive-modules/spring-reactive-3/src/main/resources/logback.xml similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/resources/logback.xml rename to spring-reactive-modules/spring-reactive-3/src/main/resources/logback.xml diff --git a/spring-reactive-modules/spring-5-reactive/src/main/resources/static/client-websocket.html b/spring-reactive-modules/spring-reactive-3/src/main/resources/static/client-websocket.html similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/main/resources/static/client-websocket.html rename to spring-reactive-modules/spring-reactive-3/src/main/resources/static/client-websocket.html diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/SpringContextTest.java b/spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/SpringContextTest.java similarity index 75% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/SpringContextTest.java rename to spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/SpringContextTest.java index bedb30fcaa..2dbd45349f 100644 --- a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/SpringContextTest.java +++ b/spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/SpringContextTest.java @@ -5,10 +5,10 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.reactive.Spring5ReactiveApplication; +import com.baeldung.functional.FunctionalWebApplication; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Spring5ReactiveApplication.class) +@SpringBootTest(classes = FunctionalWebApplication.class) public class SpringContextTest { @Test diff --git a/spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java b/spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java rename to spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java diff --git a/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java b/spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java similarity index 87% rename from spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java rename to spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java index 94979a18ca..79c694e6b9 100644 --- a/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java +++ b/spring-reactive-modules/spring-reactive-3/src/test/java/com/baeldung/reactive/actuator/ActuatorInfoIntegrationTest.java @@ -9,8 +9,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; -import java.io.IOException; - import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) @@ -21,13 +19,13 @@ public class ActuatorInfoIntegrationTest { private TestRestTemplate restTemplate; @Test - public void whenGetInfo_thenReturns200() throws IOException { + public void whenGetInfo_thenReturns200() { final ResponseEntity responseEntity = this.restTemplate.getForEntity("/actuator/info", String.class); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); } @Test - public void whenFeatures_thenReturns200() throws IOException { + public void whenFeatures_thenReturns200() { final ResponseEntity responseEntity = this.restTemplate.getForEntity("/actuator/features", String.class); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); } diff --git a/spring-reactive-modules/spring-5-reactive/src/test/resources/baeldung-weekly.png b/spring-reactive-modules/spring-reactive-3/src/test/resources/baeldung-weekly.png similarity index 100% rename from spring-reactive-modules/spring-5-reactive/src/test/resources/baeldung-weekly.png rename to spring-reactive-modules/spring-reactive-3/src/test/resources/baeldung-weekly.png diff --git a/spring-reactive-modules/spring-data-couchbase/README.md b/spring-reactive-modules/spring-reactive-data-couchbase/README.md similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/README.md rename to spring-reactive-modules/spring-reactive-data-couchbase/README.md diff --git a/spring-reactive-modules/spring-data-couchbase/pom.xml b/spring-reactive-modules/spring-reactive-data-couchbase/pom.xml similarity index 98% rename from spring-reactive-modules/spring-data-couchbase/pom.xml rename to spring-reactive-modules/spring-reactive-data-couchbase/pom.xml index d7b36f97fa..52b10f39d9 100644 --- a/spring-reactive-modules/spring-data-couchbase/pom.xml +++ b/spring-reactive-modules/spring-reactive-data-couchbase/pom.xml @@ -3,7 +3,7 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-data-couchbase + spring-reactive-data-couchbase spring-data-couchbase jar diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/ReactiveCouchbaseApplication.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/ReactiveCouchbaseApplication.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/ReactiveCouchbaseApplication.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/ReactiveCouchbaseApplication.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/CouchbaseProperties.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/CouchbaseProperties.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/CouchbaseProperties.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/CouchbaseProperties.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/N1QLReactiveCouchbaseConfiguration.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/N1QLReactiveCouchbaseConfiguration.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/N1QLReactiveCouchbaseConfiguration.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/N1QLReactiveCouchbaseConfiguration.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ViewReactiveCouchbaseConfiguration.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ViewReactiveCouchbaseConfiguration.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ViewReactiveCouchbaseConfiguration.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/configuration/ViewReactiveCouchbaseConfiguration.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/Person.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/Person.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/Person.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/Person.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepository.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepository.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepository.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepository.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepository.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepository.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepository.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepository.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/resources/couchbase.properties b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/resources/couchbase.properties similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/resources/couchbase.properties rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/resources/couchbase.properties diff --git a/spring-reactive-modules/spring-data-couchbase/src/main/resources/logback.xml b/spring-reactive-modules/spring-reactive-data-couchbase/src/main/resources/logback.xml similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/main/resources/logback.xml rename to spring-reactive-modules/spring-reactive-data-couchbase/src/main/resources/logback.xml diff --git a/spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/CouchbaseMockConfiguration.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/CouchbaseMockConfiguration.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/CouchbaseMockConfiguration.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/CouchbaseMockConfiguration.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepositoryLiveTest.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepositoryLiveTest.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepositoryLiveTest.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLPersonRepositoryLiveTest.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepositoryLiveTest.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepositoryLiveTest.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepositoryLiveTest.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/n1ql/N1QLSortingPersonRepositoryLiveTest.java diff --git a/spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepositoryIntegrationTest.java b/spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepositoryIntegrationTest.java similarity index 100% rename from spring-reactive-modules/spring-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepositoryIntegrationTest.java rename to spring-reactive-modules/spring-reactive-data-couchbase/src/test/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepositoryIntegrationTest.java diff --git a/spring-reactive-modules/spring-reactive-security/README.md b/spring-reactive-modules/spring-reactive-security/README.md index 37f999648c..a25fa3728b 100644 --- a/spring-reactive-modules/spring-reactive-security/README.md +++ b/spring-reactive-modules/spring-reactive-security/README.md @@ -7,6 +7,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles -- [Spring Boot Actuator](https://www.baeldung.com/spring-boot-actuators) - [Guide to the AuthenticationManagerResolver in Spring Security](https://www.baeldung.com/spring-security-authenticationmanagerresolver) - [Spring Webflux and CORS](https://www.baeldung.com/spring-webflux-cors) diff --git a/spring-reactive-modules/spring-reactive-security/pom.xml b/spring-reactive-modules/spring-reactive-security/pom.xml index 8ed976c572..bd74202437 100644 --- a/spring-reactive-modules/spring-reactive-security/pom.xml +++ b/spring-reactive-modules/spring-reactive-security/pom.xml @@ -37,10 +37,6 @@ javax.json.bind javax.json.bind-api - - org.springframework.boot - spring-boot-starter-actuator - org.projectlombok lombok diff --git a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java b/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java deleted file mode 100644 index 384e26ac8c..0000000000 --- a/spring-reactive-modules/spring-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.reactive.actuator; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; -import org.springframework.security.config.web.server.ServerHttpSecurity; -import org.springframework.security.web.server.SecurityWebFilterChain; - -@Configuration -@EnableWebFluxSecurity -public class WebSecurityConfig { - - @Bean - public SecurityWebFilterChain securitygWebFilterChain( - ServerHttpSecurity http) { - - return http.authorizeExchange() - .pathMatchers("/actuator/**").permitAll() - .anyExchange().authenticated() - .and().build(); - } - -} diff --git a/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/SpringContextTest.java b/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/SpringContextTest.java index e6123de118..a0a7d9264a 100644 --- a/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/SpringContextTest.java +++ b/spring-reactive-modules/spring-reactive-security/src/test/java/com/baeldung/SpringContextTest.java @@ -1,13 +1,14 @@ package com.baeldung; -import com.baeldung.reactive.actuator.Spring5ReactiveApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import com.baeldung.webflux.EmployeeWebSocketClient; + @RunWith(SpringRunner.class) -@SpringBootTest(classes = Spring5ReactiveApplication.class) +@SpringBootTest(classes = EmployeeWebSocketClient.class) public class SpringContextTest { @Test