Spring/webflux

webFlux 의존성 추가

용쓰개 2025. 2. 6. 16:55
implementation 'org.springframework.boot:spring-boot-starter-webflux'

를 추가하면 된다.

 

 

나의 경우 해당 의존성을 추가 해주지 않았는데도,  Mono와 Flux import가 가능했다. 다음 명령어로 어찌된 영문인지 확인해보았다.

./gradlew dependencies --configuration runtimeClasspath

 

org.springframework.boot:spring-boot-starter-data-redis -> 3.3.4
|    +--- org.springframework.boot:spring-boot-starter:3.3.4 (*)
|    +--- io.lettuce:lettuce-core:6.3.2.RELEASE
|    |    +--- io.netty:netty-common:4.1.107.Final -> 4.1.113.Final
|    |    +--- io.netty:netty-handler:4.1.107.Final -> 4.1.113.Final
|    |    |    +--- io.netty:netty-common:4.1.113.Final
|    |    |    +--- io.netty:netty-resolver:4.1.113.Final
|    |    |    |    \--- io.netty:netty-common:4.1.113.Final
|    |    |    +--- io.netty:netty-buffer:4.1.113.Final
|    |    |    |    \--- io.netty:netty-common:4.1.113.Final
|    |    |    +--- io.netty:netty-transport:4.1.113.Final
|    |    |    |    +--- io.netty:netty-common:4.1.113.Final
|    |    |    |    +--- io.netty:netty-buffer:4.1.113.Final (*)
|    |    |    |    \--- io.netty:netty-resolver:4.1.113.Final (*)
|    |    |    +--- io.netty:netty-transport-native-unix-common:4.1.113.Final
|    |    |    |    +--- io.netty:netty-common:4.1.113.Final
|    |    |    |    +--- io.netty:netty-buffer:4.1.113.Final (*)
|    |    |    |    \--- io.netty:netty-transport:4.1.113.Final (*)
|    |    |    \--- io.netty:netty-codec:4.1.113.Final
|    |    |         +--- io.netty:netty-common:4.1.113.Final
|    |    |         +--- io.netty:netty-buffer:4.1.113.Final (*)
|    |    |         \--- io.netty:netty-transport:4.1.113.Final (*)
|    |    +--- io.netty:netty-transport:4.1.107.Final -> 4.1.113.Final (*)
|    |    \--- io.projectreactor:reactor-core:3.6.4 -> 3.6.10
|    |         \--- org.reactivestreams:reactive-streams:1.0.4

org.springframework.boot:spring-boot-starter-data-redis 덕분이었다. redis가 이벤트 루프로 동작한다는 건 알고 있었는데, reactor를 사용하고 있는 줄은 몰랐다. 굿굿