spring-boot 기반 gRPC 샘플 프로젝트를 구성 합니다.
git clone https://github.com/chiwoo-samples/spring-grpc-demo.git
git config --local user.name <your_name>
git config --local user.email <your_email>
gRPC 메시지 및 서비스 객체는 client + server 가 서로 공유하는 객체이므로 grpc-demo-interface 모듈을 local maven 저장소에 install 합니다.
./gradlew clean build publishToMavenLocal --exclude-task test -p grpc-demo-interface
gRPC 클라이언트 모듈을 빌드 합니다.
./gradlew clean build --exclude-task test -p grpc-demo-client
gRPC 서버 모듈을 빌드 합니다.
./gradlew clean build --exclude-task test -p grpc-demo-server
./gradlew build bootRun --exclude-task test -p grpc-demo-server
./gradlew build bootRun --exclude-task test -p grpc-demo-client
- Sync call
curl -v -L -X GET 'http://localhost:8081/hello' --header 'Content-Type: application/json'
- Async call
curl -v -L -X GET 'http://localhost:8081/hello-async?size=1000' --header 'Content-Type: application/json'