
Reactor Netty Netty 프레임워크를 기반으로 하는 비차단 및 역압 지원 TCP / HTTP / UDP / QUIC 클라이언트 및 서버를 제공합니다.
Reactor Netty 실행하려면 Java 8 또는 +가 필요합니다.
repo.spring.io 또는 Maven Central 리포지토리의 Gradle 사용(안정적인 릴리스에만 해당):
repositories {
// maven { url 'https://repo.spring.io/snapshot' }
maven { url ' https://repo.spring.io/milestone ' }
mavenCentral()
}
dependencies {
// compile "io.projectreactor.netty:reactor-netty-core:1.2.2-SNAPSHOT"
compile " io.projectreactor.netty:reactor-netty-core:1.2.1 "
// compile "io.projectreactor.netty:reactor-netty-http:1.2.2-SNAPSHOT"
compile " io.projectreactor.netty:reactor-netty-http:1.2.1 "
} 가져오기에 대한 자세한 내용은 참조 문서를 참조하세요(예: Maven 사용 또는 마일스톤 및 스냅샷 가져오기 방법).
Reactor Netty 처음 사용하시나요? 이 Reactor Netty Workshop 및 참조 문서를 확인하세요.
다음은 매우 간단한 HTTP 서버와 해당 HTTP 클라이언트 예입니다.
HttpServer . create () // Prepares an HTTP server ready for configuration
. port ( 0 ) // Configures the port number as zero, this will let the system pick up
// an ephemeral port when binding the server
. route ( routes ->
// The server will respond only on POST requests
// where the path starts with /test and then there is path parameter
routes . post ( "/test/{param}" , ( request , response ) ->
response . sendString ( request . receive ()
. asString ()
. map ( s -> s + ' ' + request . param ( "param" ) + '!' )
. log ( "http-server" ))))
. bindNow (); // Starts the server in a blocking fashion, and waits for it to finish its initialization HttpClient . create () // Prepares an HTTP client ready for configuration
. port ( server . port ()) // Obtains the server's port and provides it as a port to which this
// client should connect
. post () // Specifies that POST method will be used
. uri ( "/test/World" ) // Specifies the path
. send ( ByteBufFlux . fromString ( Flux . just ( "Hello" ))) // Sends the request body
. responseContent () // Receives the response body
. aggregate ()
. asString ()
. log ( "http-client" )
. block (); Reactor Netty 에 문제가 있나요? 우리는 도움을 주고 싶습니다!
reactor-netty 태그가 붙은 질문을 모니터링합니다. Gitter에서 커뮤니티와 채팅할 수도 있습니다.Reactor Netty 의 버그를 보고하세요. Reactor Netty GitHub's 통합 문제 추적 시스템을 사용하여 버그와 기능 요청을 기록합니다. 문제를 제기하려면 아래 권장 사항을 따르십시오.
Reactor Netty 버전과 Operating System 및 JVM 버전을 알고 싶습니다. Reactor Netty 에 기여하는 방법에 대한 정보는 기여 가이드를 참조하세요.
Reactor Netty (repo.spring.io의 바이너리)를 사용하기 위해 소스에서 빌드할 필요는 없지만 최신 및 최고의 기능을 시험해보고 싶다면 Gradle 래퍼를 사용하여 Reactor Netty 쉽게 빌드할 수 있습니다. JDK 1.8도 필요합니다.
$ git clone https://github.com/reactor/reactor-netty.git
$ cd reactor-netty
$ ./gradlew build 로컬 Maven 저장소에 아티팩트를 게시하려면 다음을 사용하세요.
$ ./gradlew publishToMavenLocalhttps://projectreactor.io/docs/netty/release/api/
Reactor Netty 는 Apache License 2.0에 따라 출시된 오픈 소스 소프트웨어입니다.