Depois de seguir todo o processo da aula, quando executo a aplicação a execução chega ao método parseRecord do serviço de batch e é executada (ele imprime na console o tópico e todas as linhas), só que o Kafka estoura a seguinte exception:
Founded 1 registers!
--------------------------------------------
Processing new batch...
-> Topic: "USER_GENERATE_READING_REPORT"
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - [Producer clientId=producer-1] Error while fetching metadata with correlation id 3 : {"USER_GENERATE_READING_REPORT"=INVALID_TOPIC_EXCEPTION}
[kafka-producer-network-thread | producer-1] ERROR org.apache.kafka.clients.Metadata - [Producer clientId=producer-1] Metadata response reported invalid topics ["USER_GENERATE_READING_REPORT"]
org.apache.kafka.common.errors.InvalidTopicException: Invalid topics: ["USER_GENERATE_READING_REPORT"]
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidTopicException: Invalid topics: ["USER_GENERATE_READING_REPORT"]
at org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.<init>(KafkaProducer.java:1314)
at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:970)
at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:870)
at curso_kafka_ecommerce.KafkaDispatcher.send(KafkaDispatcher.java:28)
at curso_kafka_ecommerce.BatchSendMessageService.parseRecord(BatchSendMessageService.java:70)
at curso_kafka_ecommerce.KafkaService.run(KafkaService.java:53)
at curso_kafka_ecommerce.BatchSendMessageService.main(BatchSendMessageService.java:40)
Caused by: org.apache.kafka.common.errors.InvalidTopicException: Invalid topics: ["USER_GENERATE_READING_REPORT"]
O mais estranho é que, quando executo o comando de tópics na comandline, o tópico USER_GENERATE_READING_REPORT existe!
.\kafka-topics.bat --describe --bootstrap-server localhost:9092
Topic: USER_GENERATE_READING_REPORT PartitionCount: 3 ReplicationFactor: 3 Configs: segment.bytes=1073741824
Topic: USER_GENERATE_READING_REPORT Partition: 0 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
Topic: USER_GENERATE_READING_REPORT Partition: 1 Leader: 2 Replicas: 2,3,4 Isr: 2,3,4
Topic: USER_GENERATE_READING_REPORT Partition: 2 Leader: 3 Replicas: 3,4,1 Isr: 3,4,1
Topic: __consumer_offsets PartitionCount: 50 ReplicationFactor: 3 Configs: compression.type=producer,cleanup.policy=compact,segment.bytes=104857600
Topic: __consumer_offsets Partition: 0 Leader: 4 Replicas: 4,1,2 Isr: 4,1,2
Topic: __consumer_offsets Partition: 1 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
Topic: __consumer_offsets Partition: 2 Leader: 2 Replicas: 2,3,4 Isr: 2,3,4
Topic: __consumer_offsets Partition: 3 Leader: 3 Replicas: 3,4,1 Isr: 3,4,1
...
Não estou sabendo qual pode ser o erro.