简体   繁体   English

卡夫卡多个主题到同一个avro文件

[英]Kafka multiple Topics into the same avro file

i am new of the KAFKA protocol's world and i would like to ask you some inportant information related to my project. 我是KAFKA协议领域的新手,我想问一些与我的项目有关的重要信息。

I am using AVRO file for producing and consuming messages, i want to know if i can use the same avro file for multiple Topics maybe for example by using a different "name" attribute into the producer and by using a specific "name" attribute in the consumer. 我正在使用AVRO文件生成和使用消息,我想知道是否可以对多个主题使用相同的avro文件,例如,可以通过在生产者中使用不同的“名称”属性,并在其中使用特定的“名称”属性消费者。

Thanks a lot. 非常感谢。 Stefano 斯特凡诺

You can use one file to send data to multiple topics, yes, although I'm not sure why one would do that 您可以使用一个文件将数据发送到多个主题,是的,尽管我不确定为什么会这样做

I would be cautious about merging multiple topics into one Avro file because the schema must match in every topic for that file 对于将多个主题合并到一个Avro文件中,我会保持谨慎,因为架构必须在该文件的每个主题中都匹配

It would be suggested that you use the Confluent Schema Registry, for example, rather than sending individual Avro events because if you are not using some registry, then you're likely sending the Avro schema as part of every message, which will slow down the possible throughput of your topic. 建议您例如使用Confluent Schema Registry,而不是发送单个Avro事件,因为如果不使用某些注册表,则很可能会将Avro模式作为每条消息的一部分发送,这将减慢Avro事件的发送速度。您的主题可能的吞吐量。 And then, the name of the Avro schema record in the register will correspond to the topic name 然后,寄存器中的Avro模式记录的名称将与主题名称相对应

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM