如何解决如何处理或创建从 kafka 接收的数据的模型类,这些数据是从 Neo4j 流发出的?
我正在尝试从 kafka 中了解从 neo4j 流发送到一个 kafka 主题的接收模型。
实际上,这些数据如下所示。
{
"meta": {
"timestamp": 1608725179199,"username": "neo4j","txId": 16443,"txEventId": 0,"txEventsCount": 1,"operation": "created","source": {
"hostname": "9945"
}
},"payload": {
"id": "1000","before": null,"after": {
"properties": {
"name": "sdfdf"
},"labels": [
"aaq"
]
},"type": "node"
},"schema": {
"properties": {
"name": "String"
},"constraints": []
}
}
那么要在 kafka 的 springboot 中使用这种类型的复杂结构化数据,我们需要创建嵌套模型吗?
我的意思是将近 4 个类相互嵌套?
据我所知,我正在尝试创建以下类。
meta (**This is 1st class**)
"operation": "created",payload(**This is 2ndclass which is nested inside the Meta**)
id
before
after(**it is 3rd class which is nested to payload**)
properties(**it is 4th class which is nested with in after**)
these data only we needed to store
labels
type
实际上我之前没有遇到过这种嵌套问题,所以不知道要处理吗?
那么上述方法是否正确,或者还有其他可能性吗?
最终目标是必须消耗来自 kafka 主题的数据,而这些数据是由 Neo4j 流发出的吗?
语言:Java
框架:Springboot
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。