/gRPC-calculator

A simple gRPC calling remote objects locally with high performance using protocol buffers and Go

Primary LanguageGo

gRPC calculator

A simple gRPC service calling remote objects with low latency, using protocol buffers and Go

Bug fixes to original code

  • added support for CLI arguments for operands
  • the client app: ensures output is only a single Int32 value by calling result.GetResult(), not the full *pb.AddResponse (ex: 4 vs Result:4)

Usage notes

  • ensure Docker maps port 50052 on the container
  • the server and client must be executed from the root directory for logging to work:
    • go run ./cmd/client.go
    • ./bin/client
  • querying via grpcurl:
    • grpcurl -plaintext localhost:50052 list
    • grpcurl -plaintext -d '{"Operand1":24,"Operand2":42}' localhost:50052 calculator.Calculator/Multiply

TODO

  • add gRPC unit tests