简体   繁体   中英

Kafka Producer 0.8.2.1 warning

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?

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.

eg

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM