Kafka生产消费API JAVA实现
Maven依赖: <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>0.10.0.0</version> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.11</artifactId> <version>0.10.0.0</version> </dependency> Kafka生产者简单接口JAVA实现: import org.apache.kafka.clients.producer.*; import java.util.Properties; public class KafkaProducer { public static void main(String[] args) throws Exception{ String topic = ""; String brokerList = ""; String message = ""; Properties props = new Properties(); props.put("bootstrap.servers", brokerList); props.put(