I have a simple demo of produce messages. But the demo always throws exception – org.apache.kafka.common.errors.TimeoutException: Topic topic_avd not present in metadata after 60000 ms.
This is my kafka config
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "pkc-lzvrd.us-west4.gcp.confluent.cloud:9092");
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
"org.apache.kafka.common.serialization.StringSerializer");
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
"io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer");
props.put("security.protocol", "SASL_SSL");
props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required serviceName='abcd' username='{{ SOMETHING }}' password='{{ SOMETHING }}';");
props.put("sasl.mechanisms", "PLAIN");
props.put("client.dns.lookup", "use_all_dns_ips");
props.put("session.timeout.ms", "45000");
props.put("schema.registry.url", "https://psrc-vrpp5.us-east-2.aws.confluent.cloud");
props.put("basic.auth.credentials.source", "USER_INFO");
props.put("basic.auth.user.info", "{{ SOMETHING }}:{{ SOMETHING }}");