google/protocol-buffers

Protocol Buffers : Language Guide (proto3) - Defining Services

C/H 2018. 9. 6. 08:30

Index

Defining Services 서비스 정의

If you want to use your message types with an RPC (Remote Procedure Call) system, you can define an RPC service interface in a .proto file and the protocol buffer compiler will generate service interface code and stubs in your chosen language. So, for example, if you want to define an RPC service with a method that takes your SearchRequest and returns a SearchResponse, you can define it in your .proto file as follows:
RPC(Remote Procedure Call) 시스템에서 메시지 유형을 사용하려면 .proto 파일로 RPC 서비스 인터페이스를 정의하면 프로토콜 버퍼 컴파일러가 선택한 언어로 서비스 인터페이스 코드와 스텁을 생성한다. 예를 들어 SearchRequest를 가져와서 SearchResponse를 반환하는 방법으로 RPC 서비스를 정의하려는 경우 다음과 같이 .proto 파일에서 정의할 수 있다.

service SearchService {
    rpc Search (SearchRequest) returns (SearchResponse);
}

The most straightforward RPC system to use with protocol buffers is gRPC: a language- and platform-neutral open source RPC system developed at Google. gRPC works particularly well with protocol buffers and lets you generate the relevant RPC code directly from your .proto files using a special protocol buffer compiler plugin.
프로토콜 버퍼에 사용하는 가장 간단한 RPC 시스템은 gRPC이다. gRPC는 Google에서 개발한 언어 및 플랫폼 중립 오픈 소스 RPC 시스템이다. gRPC는 특히 프로토콜 버퍼에서 잘 작동하며 특수 프로토콜 버퍼 컴파일러 플러그인을 사용하여 .proto 파일에서 관련 RPC 코드를 직접 생성할 수 있다.

If you don't want to use gRPC, it's also possible to use protocol buffers with your own RPC implementation. You can find out more about this in the Proto2 Language Guide.
gRPC를 사용하지 않으려면 RPC 구현 시 프로토콜 버퍼를 사용할 수도 있다. 자세한 내용은 Proto2 언어 가이드를 참조하라.

There are also a number of ongoing third-party projects to develop RPC implementations for Protocol Buffers. For a list of links to projects we know about, see the third-party add-ons wiki page.
또한 프로토콜 버퍼를 위한 RPC 구현을 개발하기 위한 많은 제3자 프로젝트들이 진행 중이다. 우리가 알고 있는 프로젝트에 대한 링크 목록을 보려면 타사 추가 기능 Wiki 페이지를 참조하라.

반응형