Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Fetching topic metadata with correlation id 0 for topics

Fetching topic metadata with correlation id 0 for topics

Rising Star

HI ,

I am getting this error while running producer java program 

 

1 [main] WARN kafka.client.ClientUtils$ - Fetching topic metadata with correlation id 0 for topics [Set(test)] from broker [BrokerEndPoint(0,abc.com,9092)] failed

 

producer.java

 

import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;

public class SimpleProducer {


public SimpleProducer() {

}

public static void main(String[] args) {

Producer<Integer, String> producer;
Properties properties = new Properties();

properties.put("metadata.broker.list", "abc.com:9092,abc2.com:9092,abc3.com:9092");
properties.put("serializer.class", "kafka.serializer.StringEncoder");
properties.put("request.required.acks", "1");

producer = new Producer<>(new ProducerConfig(properties));

String topic = "test";

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

long millisecondsAgo = new Date().getTime();
String sCurrentLine = formatter.format(millisecondsAgo);
System.out.println("Pushing data");
KeyedMessage<Integer, String> data = new KeyedMessage<>(topic, "Added at - " + sCurrentLine);;

producer.send(data);
System.out.println("Pushed data at - " + sCurrentLine);

producer.close();
}
}

 

what could be the reason for this error .

 

however producer-console is working fine 

1 REPLY 1
Highlighted

Re: Fetching topic metadata with correlation id 0 for topics

Rising Star
0 [main] WARN kafka.utils.VerifiableProperties - Property sasl.kerberos.service.name is not valid
2 [main] WARN kafka.utils.VerifiableProperties - Property security.protocol is not valid
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/jars/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/jars/avro-tools-1.7.6-cdh5.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/jars/pig-0.12.0-cdh5.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
I ma getting this 174 [main] WARN kafka.client.ClientUtils$ - Fetching topic metadata with correlation id 0 for topics [Set(test)] from broker [BrokerEndPoint(0,wuwcc9hdmn03.prod.wudip.com,9092)] failed