Clients -
kafka :
Producer
Represent a Kafka producer endpoint.
Constructor
__init
(ProducerConfiguration config)
- config ProducerConfiguration
-
Configurations related to initializing a Kafka
Producer
.
Remote Methods
close | Closes producer connection to the external Kafka broker. |
commitConsumer | Commits consumer action which commits consumer consumed offsets to offset topic. |
commitConsumerOffsets | CommitConsumerOffsets action which commits consumer offsets in given transaction. |
flushRecords | Flush action which flush batch of records. |
getTopicPartitions | GetTopicPartitions action which returns given topic partition information. |
send | Simple Send action which produce records to Kafka server. |
Fields
- producerConfig ProducerConfiguration? (default ())
-
Used to store configurations related to a Kafka connection.
- connectorId string (default 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
(anydata value, string topic, anydata? key, int? partition, int? timestamp)
returns ProducerError?Simple Send action which produce records to Kafka server.
Parameters
- value anydata
-
Record contents.
- topic string
-
Topic to which the record will be appended to.
- key anydata? (default ())
-
Key that will be included in the record.
- partition int? (default ())
-
Partition to which the record should be sent.
- timestamp int? (default ())
-
Timestamp of the record, in milliseconds since epoch.
-
Return Type
(ProducerError?) Returns
kafka:ProducerError
if send action fails to send data, nil otherwise.