StreamsProducer¶
StreamsProducer
uses a Kafka Producer to send records for RecordCollectorImpl.
Creating Instance¶
StreamsProducer
takes the following to be created:
- StreamsConfig
- Thread ID
- KafkaClientSupplier
- TaskId
- Process ID
-
LogContext
StreamsProducer
is created when:
ActiveTaskCreator
is created and requested to createActiveTask
Kafka Producer¶
StreamsProducer
requests the KafkaClientSupplier to get a Kafka Producer (Producer<byte[], byte[]>
) when created and requested to resetProducer.
Sending Record¶
Future<RecordMetadata> send(
ProducerRecord<byte[], byte[]> record,
Callback callback)
send
maybeBeginTransaction and requests the Producer to send the record (with the given Callback
).
send
is used when:
RecordCollectorImpl
is requested to send a record
maybeBeginTransaction¶
void maybeBeginTransaction()
maybeBeginTransaction
...FIXME
maybeBeginTransaction
is used when:
StreamsProducer
is requested to send a record and commitTransaction
commitTransaction¶
void commitTransaction(
Map<TopicPartition, OffsetAndMetadata> offsets,
ConsumerGroupMetadata consumerGroupMetadata)
commitTransaction
...FIXME
commitTransaction
is used when:
TaskManager
is requested to commitOffsetsOrTransactionTopologyTestDriver
is requested to commit