Skip to content

Commit abf73ec

Browse files
authored
Add more explanation about payload mode in source query (#79)
1 parent d0c0ef8 commit abf73ec

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

modules/ROOT/examples/docker-data/source.query.json-string.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"neo4j.query.polling-interval": "1s",
1919
"neo4j.query.polling-duration": "5s"
2020
}
21-
}
21+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "<name>",
3+
"surname": "<surname>",
4+
"timestamp": <timestamp>
5+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"name": {
3+
"type": "S",
4+
"B": null,
5+
"I64": null,
6+
"F64": null,
7+
"S": "<name>",
8+
"BA": null,
9+
"TLD": null,
10+
"TLDT": null,
11+
"TLT": null,
12+
"TZDT": null,
13+
"TOT": null,
14+
"TD": null,
15+
"SP": null,
16+
"LB": null,
17+
"LI64": null,
18+
"LF64": null,
19+
"LS": null,
20+
"LTLD": null,
21+
"LTLDT": null,
22+
"LTLT": null,
23+
"LZDT": null,
24+
"LTOT": null,
25+
"LTD": null,
26+
"LSP": null
27+
},
28+
"surname": {
29+
"type": "S",
30+
"B": null,
31+
"I64": null,
32+
"F64": null,
33+
"S": "<surname>",
34+
"BA": null,
35+
"TLD": null,
36+
"TLDT": null,
37+
"TLT": null,
38+
"TZDT": null,
39+
"TOT": null,
40+
"TD": null,
41+
"SP": null,
42+
"LB": null,
43+
"LI64": null,
44+
"LF64": null,
45+
"LS": null,
46+
"LTLD": null,
47+
"LTLDT": null,
48+
"LTLT": null,
49+
"LZDT": null,
50+
"LTOT": null,
51+
"LTD": null,
52+
"LSP": null
53+
},
54+
"timestamp": {
55+
"type": "I64",
56+
"B": null,
57+
"I64": <timestamp>,
58+
"F64": null,
59+
"S": null,
60+
"BA": null,
61+
"TLD": null,
62+
"TLDT": null,
63+
"TLT": null,
64+
"TZDT": null,
65+
"TOT": null,
66+
"TD": null,
67+
"SP": null,
68+
"LB": null,
69+
"LI64": null,
70+
"LF64": null,
71+
"LS": null,
72+
"LTLD": null,
73+
"LTLDT": null,
74+
"LTLT": null,
75+
"LZDT": null,
76+
"LTOT": null,
77+
"LTD": null,
78+
"LSP": null
79+
}
80+
}

modules/ROOT/pages/source/query.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,19 @@ curl -X POST http://localhost:8083/connectors \
101101
This will create a Kafka Connect source instance that will send change event messages derived by the provided query over to the `my-topic` topic, using your preferred serialization format.
102102
In Control Center, confirm that the Source connector has been created in the Connect tab, under connect-default.
103103

104-
Generated change event messages in this case will have the following structure:
104+
Generated change event messages in this case will have the following structure, which wraps each field into a dedicated structure which is type safe:
105105

106106
[source,json]
107107
----
108-
{"name": <name>, "surname": <surname>, "timestamp": <timestamp>}
108+
include::example$producer-data/query.extended.json[]
109109
----
110+
111+
While the above serialized form of the change message is forward compatible in terms of property type changes, it might make the consumer side deserialization logic quite complex and not desired.
112+
In this case, you can configure `neo4j.payload-mode` setting as `COMPACT` so that change event messages will instead be structured as follows:
113+
114+
[source,json]
115+
----
116+
include::example$producer-data/query.compact.json[]
117+
----
118+
119+
Refer to the xref:source/payload-mode.adoc[payload mode] page for more information about the `neo4j.payload-mode` setting, including its limitations.

0 commit comments

Comments
 (0)