spring-boot - 如何处理或创建从 kafka 接收的从 Neo4j 流发出的数据的模型类?
问题描述
我试图了解从 Neo4j 流向一个 kafka 主题发出的 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
解决方案
推荐阅读
- c++ - 如果语句没有被评估 C++
- build - 将 DACPAC 部署到多个数据库
- python - 为什么简单反向传播击败 Nesterov 和 RMSProp
- r - ggplot2:不知道如何为标记类型的对象自动选择比例
- javascript - 将 Array.map 中的当前/选定元素渲染到模态
- python - Python将地图绘制到球体上
- javascript - 仅在锚标记上的 href onlick 上禁用页面重新加载
- node.js - NodeJS 数据库竞争条件
- sql - 在 BigQuery Standard SQL 中获取 Last Slash 之后的字符串
- windows - Windows 7 - 高 DPI - RAD Studio XE7 的 SetProcessDPIAware 问题?