producer接口: /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this…
1.Producer 网络请求 1.1 Producer Client角度 KafkaProducer主要靠Sender来发送数据给Broker. Sender: 该线程handles the sending of produce requests to the Kafka cluster. 该线程发送metadata requests来更新它感知的整个集群的视图;另外,主要负责发送produce请求到相关的broker. Selector的主要目的是网络事件的 loop 循环,通过调用sele…