grpc_client
This component is experimental and therefore subject to change or removal outside of major version releases.
Receives messages from a gRPC server.
- Common
- Advanced
# Common config fields, showing default values
input:
label: ""
grpc_client:
address: localhost:50051 # No default (required)
service: helloworld.Greeter # No default (required)
method: SayHello # No default (required)
rpc_type: unary
reflection: false
proto_files: []
health_check: {}
payload: "" # No default (optional)
rate_limit: "" # No default (optional)
auto_replay_nacks: true
# All config fields, showing default values
input:
label: ""
grpc_client:
address: localhost:50051 # No default (required)
service: helloworld.Greeter # No default (required)
method: SayHello # No default (required)
rpc_type: unary
reflection: false
proto_files: []
tls:
enabled: false
skip_cert_verify: false
enable_renegotiation: false
root_cas: ""
root_cas_file: ""
client_certs: []
oauth2:
enabled: false
client_key: ""
client_secret: ""
token_url: ""
scopes: []
endpoint_params: {}
health_check:
enabled: false
service: ""
payload: "" # No default (optional)
rate_limit: "" # No default (optional)
auto_replay_nacks: true
Expected Message Format
Either the field reflection or proto_files must be supplied, which will provide the protobuf schema Bento will use to marshall the Bento message into protobuf.
Fields
address
The URI of the gRPC target to connect to.
Type: string
# Examples
address: localhost:50051
service
The name of the service.
Type: string
# Examples
service: helloworld.Greeter
method
The name of the method to invoke.
Type: string
# Examples
method: SayHello
rpc_type
The type of the rpc method.
Type: string
Default: "unary"
Options: unary, client_stream, server_stream, bidi.
reflection
If set to true, Bento will acquire the protobuf schema for the method from the server via gRPC Reflection.
Type: bool
Default: false
proto_files
A list of filepaths of .proto files that should contain the schemas necessary for the gRPC method.
Type: array
Default: []
# Examples
proto_files:
- ./grpc_test_server/helloworld.proto
tls
Custom TLS settings can be used to override system defaults.
Type: object
tls.enabled
Whether custom TLS settings are enabled.
Type: bool
Default: false
tls.skip_cert_verify
Whether to skip server side certificate verification.
Type: bool
Default: false
tls.enable_renegotiation
Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message local error: tls: no renegotiation.
Type: bool
Default: false
Requires version 1.0.0 or newer
tls.root_cas
An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info.
Type: string
Default: ""
# Examples
root_cas: |-
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
tls.root_cas_file
An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
Type: string
Default: ""
# Examples
root_cas_file: ./root_cas.pem
tls.client_certs
A list of client certificates to use. For each certificate either the fields cert and key, or cert_file and key_file should be specified, but not both.
Type: array
Default: []
# Examples
client_certs:
- cert: foo
key: bar
client_certs:
- cert_file: ./example.pem
key_file: ./example.key
tls.client_certs[].cert
A plain text certificate to use.
Type: string
Default: ""
tls.client_certs[].key
A plain text certificate key to use.
This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info.
Type: string
Default: ""
tls.client_certs[].cert_file
The path of a certificate to use.
Type: string
Default: ""
tls.client_certs[].key_file
The path of a certificate key to use.
Type: string
Default: ""
tls.client_certs[].password
A plain text password for when the private key is password encrypted in PKCS#1 or PKCS#8 format. The obsolete pbeWithMD5AndDES-CBC algorithm is not supported for the PKCS#8 format. Warning: Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.
This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info.
Type: string
Default: ""
# Examples
password: foo
password: ${KEY_PASSWORD}
oauth2
Allows you to specify open authentication via OAuth version 2 using the client credentials token flow.
Type: object
oauth2.enabled
Whether to use OAuth version 2 in requests.
Type: bool
Default: false
oauth2.client_key
A value used to identify the client to the token provider.
Type: string
Default: ""
oauth2.client_secret
A secret used to establish ownership of the client key.
This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info.
Type: string
Default: ""
oauth2.token_url
The URL of the token provider.
Type: string
Default: ""
oauth2.scopes
A list of optional requested permissions.
Type: array
Default: []
oauth2.endpoint_params
A list of optional endpoint parameters, values should be arrays of strings.
Type: object
Default: {}
# Examples
endpoint_params:
bar:
- woof
foo:
- meow
- quack
health_check
Options for gRPC Health Checking.
Type: object
health_check.enabled
Whether Bento should healthcheck the unary Check rpc endpoint on init connection.
Type: bool
Default: false
health_check.service
The name of the service to healthcheck, note that the default value of "", will attempt to check the health of the whole server.
Type: string
Default: ""
payload
For rpc_type values: unary, client_stream & server_stream, the payload field defines the data that is sent as the request.
In the instance of the client_stream rpc_type - this is expected to resolve to an array. The array will be sent as a stream, with the elements
making the individual messages.
This field supports interpolation functions.
Type: string
rate_limit
An optional rate limit to throttle requests by.
Type: string
auto_replay_nacks
Whether messages that are rejected (nacked) at the output level should be automatically replayed indefinitely, eventually resulting in back pressure if the cause of the rejections is persistent. If set to false these messages will instead be deleted. Disabling auto replays can greatly improve memory efficiency of high throughput streams as the original shape of the data can be discarded immediately upon consumption and mutation.
Type: bool
Default: true