gRPC Configuration:

Enable or disable gRPC protocol support. When enabled and proto descriptors are loaded (via grpcDescriptorDirectory, grpcProtoDirectory, or the PUT /mockserver/grpc/descriptors REST API), MockServer intercepts gRPC requests on HTTP/2 connections, converts protobuf to JSON, and routes them through the standard expectation matching engine. Without loaded descriptors, gRPC interception is not active even when this property is true.

Type: boolean Default: true

Java Code:

ConfigurationProperties.grpcEnabled(boolean enable)

System Property:

-Dmockserver.grpcEnabled=...

Environment Variable:

MOCKSERVER_GRPC_ENABLED=...

Property File:

mockserver.grpcEnabled=...

Example:

-Dmockserver.grpcEnabled="false"

Directory containing pre-compiled proto descriptor set files (.dsc or .desc). MockServer loads all descriptor files from this directory at startup and registers their services for gRPC mocking.

Generate descriptor files using protoc --descriptor_set_out=service.dsc --include_imports service.proto.

Type: string Default: null

Java Code:

ConfigurationProperties.grpcDescriptorDirectory(String directory)

System Property:

-Dmockserver.grpcDescriptorDirectory=...

Environment Variable:

MOCKSERVER_GRPC_DESCRIPTOR_DIRECTORY=...

Property File:

mockserver.grpcDescriptorDirectory=...

Example:

-Dmockserver.grpcDescriptorDirectory="/path/to/descriptors"

Directory containing .proto source files. MockServer compiles these files at startup using protoc and registers their services for gRPC mocking. Requires protoc to be available on the system PATH (or configured via grpcProtocPath).

Type: string Default: null

Java Code:

ConfigurationProperties.grpcProtoDirectory(String directory)

System Property:

-Dmockserver.grpcProtoDirectory=...

Environment Variable:

MOCKSERVER_GRPC_PROTO_DIRECTORY=...

Property File:

mockserver.grpcProtoDirectory=...

Example:

-Dmockserver.grpcProtoDirectory="/path/to/protos"

Path to the protoc compiler binary. Only needed when using grpcProtoDirectory to compile .proto files at startup. If protoc is on the system PATH, the default value works without configuration.

Type: string Default: "protoc"

Java Code:

ConfigurationProperties.grpcProtocPath(String path)

System Property:

-Dmockserver.grpcProtocPath=...

Environment Variable:

MOCKSERVER_GRPC_PROTOC_PATH=...

Property File:

mockserver.grpcProtocPath=...

Example:

-Dmockserver.grpcProtocPath="/usr/local/bin/protoc"