Clients -
kafka :
Producer
Represent a Kafka producer endpoint.
Constructor
__init
(ProducerConfig config)
- config ProducerConfig
Remote Methods
Closes producer connection to the external Kafka broker.
Commits consumer action which commits consumer consumed offsets to offset topic.
CommitConsumerOffsets action which commits consumer offsets in given transaction.
Flush action which flush batch of records.
GetTopicPartitions action which returns given topic partition information.
Simple Send action which produce records to Kafka server.
Fields
- producerConfig ProducerConfig? ()
-
Used to store configurations related to a Kafka connection.
- connectorId string system:uuid()
-
Unique ID for a particular connector.
Closes producer connection to the external Kafka broker.
-
Return Type
(ProducerError?) kafka:ProducerError
if closing the producer failed, nil otherwise.
Commits consumer action which commits consumer consumed offsets to offset topic.
Parameters
- consumer Consumer
-
Consumer which needs offsets to be committed.
-
Return Type
(ProducerError?) kafka:ProducerError
if committing the consumer failed, nil otherwise.
CommitConsumerOffsets action which commits consumer offsets in given transaction.
Parameters
- offsets PartitionOffset[]
-
Consumer offsets to commit for given transaction.
- groupID string
-
Consumer group id.
-
Return Type
(ProducerError?) kafka:ProducerError
if committing consumer offsets failed, nil otherwise.
Flush action which flush batch of records.
-
Return Type
(ProducerError?) kafka:ProducerError
if records couldn't be flushed, nil otherwise.
GetTopicPartitions action which returns given topic partition information.
Parameters
- topic string
-
Topic which the partition information is given.
-
Return Type
(TopicPartition[] | ProducerError) kafka:TopicPartition
array for the given topic, returnskafka:ProducerError
if operation fails.
send
(byte[] value, string topic, byte[]? key, int? partition, int? timestamp)
returns ProducerError?Simple Send action which produce records to Kafka server.
Parameters
- value byte[]
-
Record contents.
- topic string
-
Topic to which the record will be appended to.
- key byte[]? - ()
-
Key that will be included in the record.
- partition int? - ()
-
Partition to which the record should be sent.
- timestamp int? - ()
-
Timestamp of the record, in milliseconds since epoch.
-
Return Type
(ProducerError?) Returns
kafka:ProducerError
if send action fails to send data, nil otherwise.