简体   繁体   English

如何将 MessagePack 编码的消息从 Kafka 接收到 MongoDB

[英]How to sink MessagePack-encoded messages into MongoDB from Kafka

I have a Kafka topic where the values are MessagePack-encoded.我有一个 Kafka 主题,其中的值是 MessagePack 编码的。

Is there any way to sink the records from this topic into MongoDB using the MongoDB Kafka connector, or must the record values simply be stored as JSON?有没有办法使用 MongoDB Kafka 连接器将来自该主题的记录下沉到 MongoDB 中,或者必须将记录值简单地存储为 JSON?

You will need to find or create your own Kafka Connect Converter , then add that package to each Connect worker's classpath, followed by setting it as your key/value converter setting, from which the existing Mongo Sink Connector can deserialize the messages into a Struct and Schema form, and handle correctly.您将需要找到或创建自己的 Kafka Connect Converter ,然后将 package 添加到每个 Connect worker 的类路径中,然后将其设置为您的键/值转换器设置,现有的 Mongo Sink Connector 可以从中将消息反序列化为StructSchema形式,并正确处理。

JSON was never a requirement. JSON 从来都不是必需品。 Avro and Protobuf should work as well Avro 和 Protobuf 也应该可以工作

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

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