kafka序列化

发布于 2025-02-13 16:00:46 字数 419 浏览 1 评论 0原文

@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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风追烟花雨 2025-02-20 16:00:47

正如错误所说,您缺少一个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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文