Skip to main content
Version: 8.3 Beta 🚧

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​

TypeParameterDescription
StringconnectorThe name of the Kafka connector.
StringtopicThe name of the Kafka topic.
StringkeyThe Kafka record key, used in identifying the record.
StringvalueThe Kafka record value you want to send.
IntegerpartitionThe partition to target. Optional.
LongtimestampThe record timestamp, in milliseconds. Optional.
ListheaderKeysThe header keys for the record. Optional.
ListheaderValuesThe header values for the record. Optional.
DictionaryoptionsCustom 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)