1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| @startuml
hide footbox
' https://matt33.com/2017/06/25/kafka-producer-send-module/ ' https://matt33.com/2017/08/22/producer-nio/ participant producer as "producer" participant accu [ =accumulator ---- Map<TopicPartition, Deque <RecordBatch>> batches ] participant sender as "sender"
[->producer: send(record) producer -> accu: append(topic, partition, data) accu --> producer: future [<-producer: sucess
note over sender org.apache.kafka.clients. producer.internals.Sender#run(long) end note sender -> accu: ready note right: get the list of partitions \nwith data ready to send accu --> sender: list<ready kafka brokers> sender -> accu: drain note right: create produce requests accu --> sender: map<broker, records> activate sender
sender->]:send produce request to kafka sender<-]:recv produce response from kafka sender->sender: Handle produce response note left: Handle produce response\norg.apache.kafka.clients.\nproducer.internals.Sender#handleProduceResponse
activate sender sender->sender: completeBatch sender -> accu: deallocate / reenqueue deactivate sender deactivate sender
@enduml
|