diff --git a/modules/ROOT/examples/docker-data/source.query.json-string.json b/modules/ROOT/examples/docker-data/source.query.json-string.json index 2efc7cd..4f230d0 100644 --- a/modules/ROOT/examples/docker-data/source.query.json-string.json +++ b/modules/ROOT/examples/docker-data/source.query.json-string.json @@ -18,4 +18,4 @@ "neo4j.query.polling-interval": "1s", "neo4j.query.polling-duration": "5s" } -} \ No newline at end of file +} diff --git a/modules/ROOT/examples/producer-data/query.compact.json b/modules/ROOT/examples/producer-data/query.compact.json new file mode 100644 index 0000000..222dc12 --- /dev/null +++ b/modules/ROOT/examples/producer-data/query.compact.json @@ -0,0 +1,5 @@ +{ + "name": "", + "surname": "", + "timestamp": +} diff --git a/modules/ROOT/examples/producer-data/query.extended.json b/modules/ROOT/examples/producer-data/query.extended.json new file mode 100644 index 0000000..fa568cc --- /dev/null +++ b/modules/ROOT/examples/producer-data/query.extended.json @@ -0,0 +1,80 @@ +{ + "name": { + "type": "S", + "B": null, + "I64": null, + "F64": null, + "S": "", + "BA": null, + "TLD": null, + "TLDT": null, + "TLT": null, + "TZDT": null, + "TOT": null, + "TD": null, + "SP": null, + "LB": null, + "LI64": null, + "LF64": null, + "LS": null, + "LTLD": null, + "LTLDT": null, + "LTLT": null, + "LZDT": null, + "LTOT": null, + "LTD": null, + "LSP": null + }, + "surname": { + "type": "S", + "B": null, + "I64": null, + "F64": null, + "S": "", + "BA": null, + "TLD": null, + "TLDT": null, + "TLT": null, + "TZDT": null, + "TOT": null, + "TD": null, + "SP": null, + "LB": null, + "LI64": null, + "LF64": null, + "LS": null, + "LTLD": null, + "LTLDT": null, + "LTLT": null, + "LZDT": null, + "LTOT": null, + "LTD": null, + "LSP": null + }, + "timestamp": { + "type": "I64", + "B": null, + "I64": , + "F64": null, + "S": null, + "BA": null, + "TLD": null, + "TLDT": null, + "TLT": null, + "TZDT": null, + "TOT": null, + "TD": null, + "SP": null, + "LB": null, + "LI64": null, + "LF64": null, + "LS": null, + "LTLD": null, + "LTLDT": null, + "LTLT": null, + "LZDT": null, + "LTOT": null, + "LTD": null, + "LSP": null + } +} \ No newline at end of file diff --git a/modules/ROOT/pages/source/query.adoc b/modules/ROOT/pages/source/query.adoc index 025d96a..e71b87e 100644 --- a/modules/ROOT/pages/source/query.adoc +++ b/modules/ROOT/pages/source/query.adoc @@ -101,9 +101,19 @@ curl -X POST http://localhost:8083/connectors \ 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. In Control Center, confirm that the Source connector has been created in the Connect tab, under connect-default. -Generated change event messages in this case will have the following structure: +Generated change event messages in this case will have the following structure, which wraps each field into a dedicated structure which is type safe: [source,json] ---- -{"name": , "surname": , "timestamp": } +include::example$producer-data/query.extended.json[] ---- + +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. +In this case, you can configure `neo4j.payload-mode` setting as `COMPACT` so that change event messages will instead be structured as follows: + +[source,json] +---- +include::example$producer-data/query.compact.json[] +---- + +Refer to the xref:source/payload-mode.adoc[payload mode] page for more information about the `neo4j.payload-mode` setting, including its limitations. \ No newline at end of file