KafkaProducerRecord
public struct KafkaProducerRecord
The messages that can be sent by a KafkaProducer.
-
Create a new
KafkaProducerRecordwith aStringvalue/keyDeclaration
Swift
public init(topic: String, value: Data, partition: Int? = nil, key: Data? = nil)Parameters
topicThe topic where the record will be sent. If this topic doesn’t exist the producer will try to create it.
valueThe message body that will be sent with the record.
partitionThe topic partition the record will be sent to. If this is not set the partition will be automatically assigned.
keyIf the partition is not set, records with the same key will be sent to the same partition. Since order is guaranteed within a partition, these records will be read in order they were produced.
-
Create a new
KafkaProducerRecordwith aDatavalue/keyDeclaration
Swift
public init(topic: String, value: String, partition: Int? = nil, key: String? = nil)Parameters
topicThe topic where the record will be sent. If this topic doesn’t exist the producer will try to create it.
valueThe message body that will be sent with the record.
partitionThe topic partition the record will be sent to. If this is not set the partition will be automatically assigned.
keyIf the partition is not set, records with the same key will be sent to the same partition. Since order is guaranteed within a partition, these records will be read in order they were produced.
KafkaProducerRecord Structure Reference