system.kafka.sendRecordAsync
This function is used in Python Scripting.
Description​
Sends a record to a specified topic asynchronously. If a metadata response is required, system.kafka.sendRecord can be used for blocking until a response is received.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.kafka.sendRecordAsync(connector, topic, key, value, [partition], [timestamp], [headerKeys], [headerValues], [options])
Parameters​
| Type | Parameter | Description |
|---|---|---|
| String | connector | The name of the Kafka connector. |
| String | topic | The name of the Kafka topic. |
| String | key | The Kafka record key, used in identifying the record. |
| String | value | The Kafka record value you want to send. |
| Integer | partition | The partition to target. Optional. |
| Long | timestamp | The record timestamp, in milliseconds. Optional. |
| List | headerKeys | The header keys for the record. Optional. |
| List | headerValues | The header values for the record. Optional. |
| Dictionary | options | Custom options specific to the producer, with key value string pairs. Optional. |
Returns​
Nothing
Scope​
Gateway
Code Examples​
Example #1
# Sends a record to the specified topic, without any blocking.
system.kafka.sendRecordAsync("MyKafkaConnector", "MyKafkaTopic", k2, 25)