Apache Kafka 0.8.2.1 - Producer (Java API) does not write messages -


i set apache kafka 0.8.2.1 in centos environment, created topic , sent / received dummy messages via command line producer / consumer.

enter image description here

as can see in screenshot worked well. no i'm writing custom producer messages java topic.

package de.jofre.kafka;  import java.util.properties;  import org.apache.kafka.clients.producer.kafkaproducer; import org.apache.kafka.clients.producer.producerrecord; import org.apache.kafka.common.serialization.stringserializer;  public class testproducer {      public static void main(string[] args) {          properties props = new properties();         props.put("bootstrap.servers", "192.168.145.130:9092");         props.put("key.serializer", stringserializer.class.getname());         props.put("value.serializer", stringserializer.class.getname());          kafkaproducer<string, string> prod = new kafkaproducer<string, string>(props);          producerrecord<string, string> record = new producerrecord<string, string>("test", "kafka great");         prod.send(record);          prod.close();     } } 

calling shown main not result message on kafka topic nor print error message.

does have idea why message not arrive in topic?

thanks morganw09dev found answer. tested dependencies org.apache.kafka kafka_2.11 0.8.2.1 , org.apache.kafka kafka-clients 0.8.2.1. non of them worked.

the dependency worked org.apache.kafka kafka_2.10 0.8.2.1. consider bug since downloaded , run kafka_2.11 binaries.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -