Apache Camel Kafka对Confluent模式注册表的支持 [英] Apache Camel Kafka support for Confluent schema Registry
问题描述
我正在尝试使用kafka组件创建骆驼路线,并尝试使用io.confluent.kafka.serializers.KafkaAvroDeserializer
和schemaRegistry url以及其他组件参数来消耗事件.我不确定Camel-Kafka当前是否完全支持此功能.有人可以对此发表评论吗?
I am trying to create camel route with kafka component trying to consume events with io.confluent.kafka.serializers.KafkaAvroDeserializer
and schemaRegistry url along with other component parameters. I am not sure if this is full supported by Camel-Kafka currently. Can someone please comment on this ?
from("kafka:{{kafka.notification.topic}}?brokers={{kafka.notification.brokers}}"
+ "&maxPollRecords={{kafka.notification.maxPollRecords}}"
+ "&seekTo={{kafka.notification.seekTo}}"
+ "&specificAvroReader=" + "true"
+ "&valueDeserializer=" + "io.confluent.kafka.serializers.KafkaAvroDeserializer"
+"&schemaRegistryURL=localhost:9021"
+ "&allowManualCommit={{kafka.notification.autocommit}})
specificAvroReader
& schemaRegistryURL
是似乎不受支持的属性.
specificAvroReader
& schemaRegistryURL
are the properties which seems to be not supported.
推荐答案
我认为,目前让camel-kafka与Confluent Schema Registry一起工作的唯一方法是编写自定义AvroSerilizer/AvroDeserializer(io.confluent.kafka.serializers .AbstractKafkaAvroSerializer/io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer).例如:
I believe the only way currently to have camel-kafka to work with Confluent Schema Registry is to write a custom AvroSerilizer/ AvroDeserializer (io.confluent.kafka.serializers.AbstractKafkaAvroSerializer/ io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer). E.g.:
BlablaDeserializer extends AbstractKafkaAvroDeserializer implements Deserializer<Object>
和
BlablaSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object>
,然后将它们设置在骆驼组件上.例如.其值将为:
and then set them on the camel component. E.g. for the value it will be:
KafkaConfiguration kafkaConfiguration.setValueDeserializer(...)
这篇关于Apache Camel Kafka对Confluent模式注册表的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!