gRPC
Discover more about the gRPC component and how to use it on the Digibee Integration Platform.
gRPC enables calls to gRPC service of the unary and client stream type via payload or via file.
Parameters
Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB)
.
Parameter | Description | Default value | Data type |
---|---|---|---|
Authenticate with client certificates | When it's activated, it can select client authentication with client certificates (mTLS). Use the Certificate Chain account type. | False | Boolean |
Authenticate with Google Key | When it's activated, it can select client authentication with Google Key. Use the Google Key account type. | False | Boolean |
Method Type | Type of method to be used in the service invocation. The supported method types are Unary, Client Stream - via Payload, and Client Stream - via File. | Unary | String |
URL | Call address of the gRPC service, for example: localhost:50051. | N/A | String |
Headers | Configures all the types of necessary headers for the call (for example: Authorization: Bearer Co4ECg1FeGFtcGxlLnByb3RvIjwKDEh). | N/A | Key-value pair |
Custom Accounts | Set the custom account label to be used in Double Braces expressions. | N/A | String |
Service Name | Name of the service described inside the configuration file .proto of the gRPC server. Learn more in Parameters additional information. | N/A | String |
Method Name | Name of the method to be described inside the configuration file .proto of the gRPC server. Learn more in Parameters additional information. | N/A | String |
Proto Descriptor File | Base64 of the “Descriptor” file from the .proto file. Learn more in Parameters additional information. | N/A | String (Base64) |
Payload | The request payload to be sent to the gRPC server. For the Unary method type, a simple object that has the fields defined in the .proto file must be used. For the Client Stream - via Payload type method, an object array, in which each array item is a message to be sent to the gRPC server, must be used. | N/A | JSON Object or Array |
File Name | Name of the file used to send the payload data in Client Stream - via File mode. This file must be a JSON file that has received an array. This array must contain the messages to be sent asynchronously to the gRPC server (stream). | N/A | String |
JSON Path | JSON Path expression that determines how the JSON file in the stream is read. Only for the Client Stream - via File mode. | N/A | String |
Connect Timeout | Expiration time of the connection with the server (in milliseconds). | 30000 | Integer |
Request Timeout | Expiration time of the component request call with the gRPC server (in milliseconds). | 30000 | Integer |
Fail On Error | If the option is activated, the execution of the pipeline with an error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property. | False | Boolean |
Parameters additional information
Service Name
See an example of Service Name as “Greeter”:
Method Name
See an example of Method Name as “helloMethod”:
Proto Descriptor File
To use this parameter, the “descriptor” must first be created from a .proto file. To create it, please follow the steps below:
Create the descriptor file by executing the following commands in the current directory located in the .proto file:
.proto file of the directory: Example.proto
Name of the descriptor file to be created: proto.desc
You can download the protoc compiler at Protocol Buffer Compiler Installation.
Encode this file to base64:
Inform this base64 in the Proto Descriptor File property.
Messages flow
Input
An input payload to be used inside the component Payload parameter is expected.
Output
When executing a SFTP component using the download, upload or move operations, the following JSON structure will be generated:
response: response JSON received from the gRPC service.
success: "true" if there’s a connection and the script is executed even without returning errors in stderr.
Output with error
success: “false” when the operation fails.
message: message about the error.
exception: information about the type of occurred error.
To better understand the message flow in the Platform, read the documentation on Message processing.
gRPC component in action
Unary
Given the .proto file example:
Firstly, it’s necessary to generate the “descriptor” file:
Inside the file directory, execute the command:
With the “descriptor” at hand, generate the base64 of the proto.desc file and add it in the Proto Descriptor File field.
Component configurations:
Method Type: Unary
URL: localhost:50051
Service Name: Greeter
Method Name: unary
Proto Descriptor File: <BASE64 OF THE DESCRIPTOR FILE GENERATE ABOVE>
Payload:
Connect Timeout: 30000
Request Timeout: 30000
Fail On Error: disabled
Response
Client Stream - via Payload
Given the .proto file:
Firstly, it’s necessary to generate the “descriptor” file:
Inside the file directory, execute the command:
With the “descriptor” at hand, generate the base64 of the proto.desc file and add it in the Proto Descriptor File field.
Component configurations:
Method Type: Client Stream - via Payload
URL: localhost:50051
Service Name: Greeter
Method Name: clientStream
Proto Descriptor File: <BASE64 OF THE DESCRIPTOR FILE GENERATED ABOVE>
Payload:
Connect Timeout: 30000
Request Timeout: 30000
Fail On Error: disabled
Response
Client Stream - via File
Given the following .proto file:
Firstly, it’s necessary to generate the “descriptor” file:
Inside the file directory, execute the command:
With the “descriptor” at hand, generate the base64 of the proto.desc file and add it in the Proto Descriptor File field.
Component configurations:
Method Type: Client Stream - via Payload
URL: localhost:50051
Service Name: Greeter
Method Name: clientStream
Proto Descriptor File: <BASE64 OF THE DESCRIPTOR FILE GENERATED ABOVE>
File Name: file.json
JSON Path: $.infos[*]
Connect Timeout: 30000
Request Timeout: 30000
Fail On Error: disabled
Response
Last updated