在我的用例中,我创建了 JDBC kafka 连接器,从 oracle 表中提取数据并成功推送到 kafka 主题,但是当我尝试从这个 kafka 主题读取消息时,我遇到了反序列化问题,如下所列。
org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id 2
Caused by: java.net.MalformedURLException: unknown protocol: localhost
at java.net.URL.<init>(URL.java:593)
at java.net.URL.<init>(URL.java:483)
at java.net.URL.<init>(URL.java:432)
at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:124)
at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:188)
at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:330)
最佳答案
问题出在 YAML 配置文件中的架构注册表 URL。注意未知协议(protocol)
错误
将其更改为(注意我将 http://
协议(protocol)添加到 URL 行),它应该可以工作:
schema:
version: latest2
registry:
url: http://localhost:8081
关于apache-kafka - Kafka 消费者因使用未知协议(protocol)反序列化 Avro 消息时出错而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55309363/