kafka序列化
@Override
public byte[] serialize(String topic, EventLegalPlanInstanceLifecycleChange record) {
return this.serializeImpl(this.getSubjectName(topic,this.isKey,record),record);
}
在上面的代码中,我会收到以下错误:
required: String,boolean,Object,ParsedSchema
found: String,boolean,EventLegalPlanInstanceLifecycleChange
reason: actual and formal argument lists differ in length
@Override
public byte[] serialize(String topic, EventLegalPlanInstanceLifecycleChange record) {
return this.serializeImpl(this.getSubjectName(topic,this.isKey,record),record);
}
With the code above I'm getting the following error:
required: String,boolean,Object,ParsedSchema
found: String,boolean,EventLegalPlanInstanceLifecycleChange
reason: actual and formal argument lists differ in length
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如错误所说,您缺少一个
parsedschema
的实例,该实例是Confluent模式注册表客户端的类。如果
eventlegalplaninstancelifecyclechange
是来自Avro/Protobuf的生成类,那么您不需要实现自己的序列化器。As the error says, you're missing an instance of a
ParsedSchema
, which is a class from Confluent Schema Registry client.If
EventLegalPlanInstanceLifecycleChange
is a generated class from Avro/Protobuf, then you shouldn't need to implement your own Serializer.