Reputation: 1387
I was able to setup a working java Kafka 0.8.2.1 producer. I need this producer to be async so that it doesn't block the thread. In the console output, I get this warning from the logger:
2016-06-10 10:55:27 WARN ProducerConfig:121 % The configuration request.timeout.ms = null was supplied but isn't a known config.
2016-06-10 10:55:27 WARN ProducerConfig:121 % The configuration producer.type = null was supplied but isn't a known config.
2016-06-10 10:55:27 WARN ProducerConfig:121 % The configuration request.required.acks = null was supplied but isn't a known config.
Can anyone please tell me why I'm getting these warning and how to fix them? My producer config is:
bootstrap.servers=hostname:9092
client.id=java.net.InetAddress.getLocalHost().getHostName()
compression.type = none
producer.type=async
block.on.buffer.full=false
value.serializer=org.apache.kafka.common.serialization.ByteArraySerializer
key.serializer=org.apache.kafka.common.serialization.StringSerializer
acks=all
request.required.acks=1
retries=2
request.timeout.ms=1200000
batch.size=16384
linger.ms=1
buffer.memory=33554432
Update1: Going through the Kafka Producer code, I do not see 'producer.type' property yet @ http://grepcode.com/file/repo1.maven.org/maven2/org.apache.kafka/kafka-clients/0.8.2.1/org/apache/kafka/clients/producer/KafkaProducer.java?av=f
Update2:Does the Kafka Java Producer not have these properties?? Still stuck here, please can anyone help?
Upvotes: 4
Views: 2516
Reputation: 1312
Ok, so your kafka cluster is up and working correctly and your producer code is giving the error. We will need to see the code of how your producer is being initialized. Typically you create a properties object with the necessary settings and pass that into a kafka.producer.ProducerConfig constructor. You can use the settings in producer.properties to start with.
e.g.
Properties props = new Properties();
props.put("request.timeout.ms", "1200000");
//add more settings to the props object
...
//finally pass in the config to the producer config.
ProducerConfig config = new ProducerConfig(props);
Upvotes: 0