简体   繁体   English

MONGODB KAFKA Source CONNECTOR 如何更改 Kafka 分区键

[英]MONGODB KAFKA Source CONNECTOR How to change Kafka Parition key

1; 1个; I try to use valuetokey to change partition key with error "Only Struct objects supported for [copying fields from value to key], found: java.lang.String";我尝试使用 valuetokey 更改分区键,但出现错误“仅支持 [将字段从值复制到键] 的结构对象,发现:java.lang.String”; 2; 2; I want update The source code MongoSourceTask.poll() for return struct type, but couldn't change it;我想更新返回结构类型的源代码 MongoSourceTask.poll(),但无法更改;

how to solve it,thanks怎么解决,谢谢

在此处输入图像描述

You shouldn't modify the connector source code.您不应修改连接器源代码。

You can use JSON (with schemas enabled), Avro, or Protobuf to get a Struct type with accessible fields您可以使用 JSON(启用模式)、Avro 或 Protobuf 来获取具有可访问字段的 Struct 类型

From your error, sounds like you'd used the StringConverter or JSONConverter with schemas disabled根据您的错误,听起来您使用了禁用模式的 StringConverter 或 JSONConverter

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

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