Skip to main content

gRPC

gRPC is a high-performance RPC framework using Protocol Buffers for serialization.

Overview

Service Discovery

Istek supports two ways to discover gRPC services:

If the server has reflection enabled:

  1. Select gRPC from the protocol dropdown
  2. Enter the server URL: localhost:50051
  3. Click Discover

Istek will automatically discover all available services and methods.

2. Proto File Upload

If reflection is not available:

  1. Click the Proto button
  2. Upload or paste your .proto file
  3. Click Parse Proto

URL Format

FormatDescription
localhost:50051Plaintext gRPC
grpc://localhost:50051Plaintext gRPC (explicit)
grpcs://localhost:50051gRPC with TLS
note

Istek converts grpc:// to http:// and grpcs:// to https:// internally, as required by the gRPC protocol.

Making a Call

After service discovery:

  1. Select a Service from the dropdown
  2. Select a Method from the dropdown
  3. Edit the JSON message
  4. Add any metadata (optional)
  5. Click Send

Message Format

gRPC messages are sent as JSON:

{
"name": "World"
}

Istek converts this to the appropriate protobuf format.

Auto-Generated Samples

When you select a method, Istek generates a sample message based on the input schema:

{
"name": "",
"age": 0,
"active": false
}

Metadata

gRPC metadata is equivalent to HTTP headers. Add custom metadata in the Metadata tab:

KeyValue
authorizationBearer {{TOKEN}}
x-request-id{{REQUEST_ID}}

Streaming Types

TypeBadgeDescription
UnaryUnarySingle request, single response
Server StreamingServer StreamSingle request, stream of responses
Client StreamingClient StreamStream of requests, single response
BidirectionalBidirectionalStream of requests and responses
note

Currently, Istek supports Unary calls. Streaming support is planned for future releases.

Response

The response shows:

  • Status Code: gRPC status (0 = OK)
  • Status Message: Human-readable status
  • Response Time: Call duration
  • Data: JSON-formatted response
  • Metadata: Response metadata/trailers

Status Codes

CodeNameDescription
0OKSuccess
1CANCELLEDOperation cancelled
2UNKNOWNUnknown error
3INVALID_ARGUMENTInvalid argument
5NOT_FOUNDResource not found
13INTERNALInternal error
14UNAVAILABLEService unavailable

Playground Example

The playground includes a gRPC Greeter service:

URL: localhost:19512

SayHello (Unary)

{
"name": "Istek"
}

Response:

{
"message": "Hello, Istek! Welcome to Istek Playground.",
"timestamp": "2024-01-15T10:30:00Z"
}

Proto Definition

syntax = "proto3";

package playground;

service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
rpc SayHelloServerStream (HelloRequest) returns (stream HelloReply);
}

message HelloRequest {
string name = 1;
}

message HelloReply {
string message = 1;
string timestamp = 2;
}

Troubleshooting

"Reflection not available"

The server doesn't have reflection enabled. Options:

  1. Enable reflection on the server
  2. Upload the proto file manually

"Transport error"

  • Check if the server is running
  • Verify the port is correct
  • Ensure you're using the right scheme (grpc:// vs grpcs://)

"Method not found"

  • Refresh service discovery
  • Check if the service name includes the package (e.g., package.ServiceName)