官方网址 源码:https://kafka.apache.org/downloads 快速开始:https://kafka.apache.org/documentation/#gettingStarted springcloud整合 发送消息流程 主线程:主线程只负责组织消息,如果是同步发送会阻塞,如果是异步发送需要传入一个回调函数。 Map集合:存储了主线程的消息。 Sender线程:真正的发送其实是sender去发送到broker中。 源码阅读 1 首先打开Producer.send()可以看到里面的内容 Future<RecordMetadata> send(ProducerRecord<K, V> record); private final String topic; private final Integer partition; private final Headers headers; private final K key; private final V value; private final Long timestamp; 2 发送之前的前置处理...