diff --git a/pom.xml b/pom.xml index a2bd38bc06..bd431ef5cd 100644 --- a/pom.xml +++ b/pom.xml @@ -615,6 +615,7 @@ spring-5-reactive-oauth spring-5-reactive-security spring-5-webflux + spring-5-webflux-2 spring-activiti spring-akka diff --git a/spring-5-webflux-2/README.md b/spring-5-webflux-2/README.md new file mode 100644 index 0000000000..0222ddbaa4 --- /dev/null +++ b/spring-5-webflux-2/README.md @@ -0,0 +1,7 @@ +## Spring 5 WebFlux 2 + +This module contains articles about Spring 5 WebFlux + +## Relevant articles: + +- [Spring Webflux and @Cacheable Annotation](https://www.baeldung.com/spring-webflux-cacheable) \ No newline at end of file diff --git a/spring-5-webflux-2/pom.xml b/spring-5-webflux-2/pom.xml new file mode 100644 index 0000000000..c90fcbe3d9 --- /dev/null +++ b/spring-5-webflux-2/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + spring-5-webflux-2 + spring-5-webflux-2 + http://www.baeldung.com + 1.0-SNAPSHOT + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter + + + org.junit.jupiter + junit-jupiter-api + + + org.junit.platform + junit-plaform-commons + + + + + io.projectreactor.addons + reactor-extra + 3.4.5 + + + com.github.ben-manes.caffeine + caffeine + 2.9.2 + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + + + io.projectreactor + reactor-test + test + + + org.testcontainers + mongodb + 1.16.2 + test + + + com.squareup.okhttp3 + mockwebserver + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java b/spring-5-webflux-2/src/main/java/caching/Item.java similarity index 96% rename from spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java rename to spring-5-webflux-2/src/main/java/caching/Item.java index 7b79ff7503..627eeef740 100644 --- a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java +++ b/spring-5-webflux-2/src/main/java/caching/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.caching; +package caching; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java b/spring-5-webflux-2/src/main/java/caching/ItemRepository.java similarity index 85% rename from spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java rename to spring-5-webflux-2/src/main/java/caching/ItemRepository.java index 27c97de36a..d69edaf5df 100644 --- a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java +++ b/spring-5-webflux-2/src/main/java/caching/ItemRepository.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.caching; +package caching; import org.springframework.data.mongodb.repository.ReactiveMongoRepository; import org.springframework.stereotype.Repository; diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java b/spring-5-webflux-2/src/main/java/caching/ItemService.java similarity index 96% rename from spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java rename to spring-5-webflux-2/src/main/java/caching/ItemService.java index b24b54521e..85d7005831 100644 --- a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java +++ b/spring-5-webflux-2/src/main/java/caching/ItemService.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.caching; +package caching; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java b/spring-5-webflux-2/src/main/java/caching/SpringWebfluxCachingApplication.java similarity index 93% rename from spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java rename to spring-5-webflux-2/src/main/java/caching/SpringWebfluxCachingApplication.java index 5266e33775..df648fe6a3 100644 --- a/spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java +++ b/spring-5-webflux-2/src/main/java/caching/SpringWebfluxCachingApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.caching; +package caching; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-5-webflux/src/main/resources/application-cache.properties b/spring-5-webflux-2/src/main/resources/application-cache.properties similarity index 100% rename from spring-5-webflux/src/main/resources/application-cache.properties rename to spring-5-webflux-2/src/main/resources/application-cache.properties diff --git a/spring-5-webflux-2/src/main/resources/logback.xml b/spring-5-webflux-2/src/main/resources/logback.xml new file mode 100644 index 0000000000..48b68c6bf1 --- /dev/null +++ b/spring-5-webflux-2/src/main/resources/logback.xml @@ -0,0 +1,31 @@ + + + + + + %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable + + + + + + netty-access.log + + %msg%n + + + + + + + + + + + + + + + + diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java b/spring-5-webflux-2/src/test/java/caching/MonoFluxResultCachingLiveTest.java similarity index 98% rename from spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java rename to spring-5-webflux-2/src/test/java/caching/MonoFluxResultCachingLiveTest.java index 322b3c5aa5..daf8367209 100644 --- a/spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java +++ b/spring-5-webflux-2/src/test/java/caching/MonoFluxResultCachingLiveTest.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.caching; +package caching; import org.junit.jupiter.api.Test; diff --git a/spring-5-webflux-2/src/test/resources/logback-test.xml b/spring-5-webflux-2/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..12cedf5952 --- /dev/null +++ b/spring-5-webflux-2/src/test/resources/logback-test.xml @@ -0,0 +1,13 @@ + + + + + + %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable + + + + + + + diff --git a/spring-5-webflux/README.md b/spring-5-webflux/README.md index 889f211fc6..bd667468fb 100644 --- a/spring-5-webflux/README.md +++ b/spring-5-webflux/README.md @@ -11,4 +11,3 @@ This module contains articles about Spring 5 WebFlux - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Set a Timeout in Spring 5 Webflux WebClient](https://www.baeldung.com/spring-webflux-timeout) - [Guide to Retry in Spring WebFlux](https://www.baeldung.com/spring-webflux-retry) -- [Spring Webflux and @Cacheable Annotation](https://www.baeldung.com/spring-webflux-cacheable) diff --git a/spring-5-webflux/pom.xml b/spring-5-webflux/pom.xml index d6afb686fc..69de83c227 100644 --- a/spring-5-webflux/pom.xml +++ b/spring-5-webflux/pom.xml @@ -66,31 +66,11 @@ - - io.projectreactor.addons - reactor-extra - 3.4.5 - - - com.github.ben-manes.caffeine - caffeine - 2.9.2 - - - org.springframework.boot - spring-boot-starter-data-mongodb-reactive - io.projectreactor reactor-test test - - org.testcontainers - mongodb - 1.16.2 - test - com.squareup.okhttp3 mockwebserver