GopherCon 2018: Joshua Humphries - gRPC reflection and grpcurl

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024
  • gRPC and Protocol Buffers are becoming industry standards for exchanging data across systems and stitching together micro-services to build scalable applications. Most devs' experience with gRPC and protobuf tooling is a program called `protoc`, which generates code to make RPC dead simple.
    But for some classes of tools, code generation is a poor fit. One such example is a general purpose command-line client. It should not be required to generate code and recompile this client every time there is a new service with which it wants to interact.
    Enter gRPC and protocol buffer reflection. Descriptors are the unit protobuf reflection. And gRPC includes a mechanism for gRPC clients to introspect on exposed services and access their descriptors. These are the building blocks of a completely dynamic gRPC client, no code generation necessary.
    `grpcurl` is a command-line program that uses these building blocks to do just that: dynamically invoke gRPC methods, enabling one to test any gRPC endpoint via a single command-line tool. It is basically cURL for gRPC (hence its name).
    Joshua’s tutorial session will touch on the Go libraries for gRPC, protocol buffers, and protobuf reflection. And it will show how these libraries are pulled together to build `grpcurl` itself.

Комментарии • 5

  • @yadongzhao4017
    @yadongzhao4017 4 года назад

    Good share.thank you a lot

  • @srishtichaurasia502
    @srishtichaurasia502 Год назад

    Are there any performance or security impacts with enabling server reflection?

  • @illayarajam1071
    @illayarajam1071 4 года назад +1

    Is it possible to invoke services without enabling server reflection, if so how to do it?

    • @jcm_dev
      @jcm_dev 3 года назад

      Yes, you just have to provide the .proto files to the CLI

  • @nishanthshanmugham
    @nishanthshanmugham 6 лет назад +3

    repository github.com/fullstorydev/grpcurl