Kafka consumer api KafkaConsumer如何识别需要检查的模式

Kafka consumer api KafkaConsumer如何识别需要检查的模式,kafka-consumer-api,avro,confluent-schema-registry,Kafka Consumer Api,Avro,Confluent Schema Registry,我使用的是ApacheAvro,主题名是“customer Avro”,假设模式注册表中有多个模式,如“customer Avro com.example.Teacher”、“customer Avro value”、customer-Avro-com.example.Student,等等。kafkaConsumer如何在从包含上述模式类型数据的主题中读取数据时确定需要检查的模式。以下是消费者的代码 KafkaConsumer<String, SpecificRecord> kafk

我使用的是ApacheAvro,主题名是“customer Avro”,假设模式注册表中有多个模式,如“customer Avro com.example.Teacher”、“customer Avro value”、customer-Avro-com.example.Student,等等。kafkaConsumer如何在从包含上述模式类型数据的主题中读取数据时确定需要检查的模式。以下是消费者的代码

KafkaConsumer<String, SpecificRecord> kafkaConsumer = new KafkaConsumer<>(properties);
    String topic = "customer-avro";
    kafkaConsumer.subscribe(Collections.singleton(topic));
      while (true){
       final ConsumerRecords<String, SpecificRecord> records = kafkaConsumer.poll(500);
        records.forEach(record -> {
            final SpecificRecord value = record.value();
            });
            }
KafkaConsumer KafkaConsumer=新的KafkaConsumer(属性);
字符串topic=“客户avro”;
kafkaConsumer.subscribe(Collections.singleton(topic));
while(true){
最终消费者记录=卡夫卡消费者调查(500);
记录。forEach(记录->{
最终SpecificRecord值=record.value();
});
}