Process GRPC receiving
Initializes the stream, sends the request, and receives messages until closure or a set limit is reached
- Parameters
- Advanced call ?
Function ProcessGRPCReceiving(Val Connection, Val Request, Val MessageCount = Undefined, Val Session = Undefined, Val Timeout = 10000) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Connection | --conn | Arbitrary | ✔ | Existing connection or connection parameters |
| Request | --req | Structure Of KeyAndValue | ✔ | Request data. See GetRequestSettings |
| MessageCount | --amount | Number | ✖ | Maximum number of messages to receive, if necessary |
| Session | --session | Structure Of KeyAndValue | ✖ | Session settings. See GetSessionSettings |
| Timeout | --tout | Number | ✖ | Timeout (in ms) |
Returns
Map Of KeyAndValue - Processing result
| Parameter | Description |
|---|---|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
URL = "http://localhost:9101";
Login = "bayselonarrend";
Password = "12we...";
Authorization = New Structure(Login, Password);
ConnectionSettings = OPI_ClickHouse.GetGRPCConnectionSettings(URL, Authorization);
Connection = OPI_ClickHouse.CreateGRPCConnection(ConnectionSettings);
SelectionText = "SELECT * FROM events_stream_test ORDER BY id";
Request = OPI_ClickHouse.GetRequestSettings(SelectionText, , , , "JSON");
Result = OPI_ClickHouse.ProcessGRPCReceiving(Connection, Request);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint clickhouse ProcessGRPCReceiving \
--conn "{'transport':'grpc','auth_type':'basic','user':'bayselonarrend','address':'http://127.0.0.1:9101','password':'***'}" \
--req "{'query':'SELECT * FROM events_stream_test ORDER BY id','format':'JSON'}"
:: JSON data can also be passed as a path to a .json file
oint clickhouse ProcessGRPCReceiving ^
--conn "{'transport':'grpc','auth_type':'basic','user':'bayselonarrend','address':'http://127.0.0.1:9101','password':'***'}" ^
--req "{'query':'SELECT * FROM events_stream_test ORDER BY id','format':'JSON'}"
Result
{
"stop_message": {
"error": "Closed",
"result": false
},
"result": true,
"messages": [
{
"message": {
"cancelled": false,
"exception": {
"code": 0,
"display_text": "",
"name": "",
"stack_trace": ""
},
"extremes": {
"BYTES": ""
},
"logs": [],
"output": {
"meta": [
{
"name": "id",
"type": "UInt64"
},
{
"name": "timestamp",
"type": "DateTime"
},
{
"name": "user_id",
"type": "UInt32"
},
{
"name": "event_type",
"type": "String"
},
{
"name": "payload",
"type": "String"
}
],
"data": [
{
"id": "1",
"timestamp": "2026-01-01 10:00:00",
"user_id": 100,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "1",
"timestamp": "2026-01-01 10:00:00",
"user_id": 100,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "1",
"timestamp": "2026-01-01 10:00:00",
"user_id": 100,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "1",
"timestamp": "2026-01-01 10:00:00",
"user_id": 100,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "2",
"timestamp": "2026-01-01 10:00:00",
"user_id": 101,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "2",
"timestamp": "2026-01-01 10:00:00",
"user_id": 101,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "2",
"timestamp": "2026-01-01 10:00:00",
"user_id": 101,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "2",
"timestamp": "2026-01-01 10:00:00",
"user_id": 101,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "3",
"timestamp": "2026-01-01 10:00:00",
"user_id": 102,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "3",
"timestamp": "2026-01-01 10:00:00",
"user_id": 102,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "3",
"timestamp": "2026-01-01 10:00:00",
"user_id": 102,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "3",
"timestamp": "2026-01-01 10:00:00",
"user_id": 102,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "4",
"timestamp": "2026-01-01 10:00:00",
"user_id": 103,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "4",
"timestamp": "2026-01-01 10:00:00",
"user_id": 103,
"event_type": "stream_test",
"payload": "{}"
},
{
"id": "4",
"timestamp": "2026-01-01 10:00:00",
"user_id": 103,
"event_type": "stream_test",
"payload": "{}"
},
{
...