gRPC Stream Endpoint
gRPC Stream Endpoint v0.28.0+ provides an endpoint implementation based on gRPC streaming communication, supporting the establishment of long connections with gRPC servers, receiving messages pushed by the server, and processing them through routing and forwarding.
# Features
- Automatic Reconnection: Automatically attempts to re-establish the connection when it is disconnected.
- Single Routing Mode: Each endpoint instance only supports configuring one message processing route.
- Shared Connection: Multiple endpoint instances with the same server address (Server) will reuse the same gRPC connection to avoid redundant connection creation.
# Type
endpoint/grpc/stream
# Configuration Parameters
Field | Type | Description | Default Value |
---|---|---|---|
server | string | gRPC server address | 127.0.0.1:9000 |
service | string | gRPC service name | ble.DataService |
method | string | gRPC method name | StreamData |
headers | map[string]string | Request headers | None |
request | string | Request data (JSON format) | None |
checkInterval | int | gRPC server check interval (milliseconds) | 10000 |
# Routing Configuration
Only one route is allowed, and the from.path
of the route must be set to *
, indicating the processing of messages from all sources.
# Configuration Example
{
"id": "GRPC Stream",
"type": "endpoint/grpc/stream",
"name": "GRPC Stream",
"debugMode": false,
"configuration": {
"server": "127.0.0.1:9000",
"service": "helloworld.Greeter",
"method": "SayHello",
"checkInterval": 10000
},
"routers": [
{
"from": {
"path": "*"
},
"to": {
"path": "bkn3fIAr8x4w:MQTT",
"wait": false
}
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Output Parameters
Messages received from the gRPC server are converted to the RuleMsg
format and sent to the rule chain:
- data: JSON format data returned by the gRPC server
- dataType: JSON
- type: Default is empty
Edit this page on GitHub (opens new window)
Last Updated: 2025/01/06, 10:45:29