Skip to content

Commit d0c0ef8

Browse files
authored
fix: raw string configuration (#78)
1 parent add2ec0 commit d0c0ef8

File tree

5 files changed

+81
-8
lines changed

5 files changed

+81
-8
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "Neo4jSourceConnectorJSONSchema",
3+
"config": {
4+
"connector.class": "org.neo4j.connectors.kafka.source.Neo4jConnector",
5+
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
6+
"key.converter.schemas.enable": true,
7+
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
8+
"value.converter.schemas.enable": true,
9+
"neo4j.uri": "neo4j://neo4j:7687",
10+
"neo4j.authentication.type": "BASIC",
11+
"neo4j.authentication.basic.username": "neo4j",
12+
"neo4j.authentication.basic.password": "password",
13+
"neo4j.source-strategy": "CDC",
14+
"neo4j.start-from": "NOW",
15+
"neo4j.cdc.poll-interval": "1s",
16+
"neo4j.cdc.poll-duration": "5s",
17+
"neo4j.cdc.topic.my-topic.patterns.0.pattern": "(:Person)",
18+
"neo4j.cdc.topic.my-topic.patterns.0.operation": "create",
19+
"neo4j.cdc.topic.my-topic.patterns.0.changesTo": "name,surname",
20+
"neo4j.cdc.topic.my-topic.patterns.0.metadata.authenticatedUser": "neo4j",
21+
"neo4j.cdc.topic.my-topic.patterns.0.metadata.executingUser": "neo4j",
22+
"neo4j.cdc.topic.my-topic.patterns.0.metadata.txMetadata.app": "sales",
23+
"neo4j.cdc.topic.my-topic.patterns.1.pattern": "(:Person)-[:KNOWS]->(:Person)",
24+
"neo4j.cdc.topic.my-topic.patterns.1.operation": "update",
25+
"neo4j.cdc.topic.my-topic.patterns.1.changesTo": "since",
26+
"neo4j.cdc.topic.my-topic.patterns.1.metadata.authenticatedUser": "neo4j",
27+
"neo4j.cdc.topic.my-topic.patterns.1.metadata.executingUser": "neo4j",
28+
"neo4j.cdc.topic.my-topic.patterns.1.metadata.txMetadata.app": "sales"
29+
}
30+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "Neo4jSourceConnectorJSONString",
3+
"config": {
4+
"connector.class": "org.neo4j.connectors.kafka.source.Neo4jConnector",
5+
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
6+
"key.converter.schemas.enable": true,
7+
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
8+
"value.converter.schemas.enable": true,
9+
"neo4j.uri": "neo4j://neo4j:7687",
10+
"neo4j.authentication.type": "BASIC",
11+
"neo4j.authentication.basic.username": "neo4j",
12+
"neo4j.authentication.basic.password": "password",
13+
"neo4j.source-strategy": "QUERY",
14+
"neo4j.start-from": "NOW",
15+
"neo4j.query": "MATCH (ts:TestSource) WHERE ts.timestamp > $lastCheck RETURN ts.name AS name, ts.surname AS surname, ts.timestamp AS timestamp",
16+
"neo4j.query.streaming-property": "timestamp",
17+
"neo4j.query.topic": "test-source",
18+
"neo4j.query.polling-interval": "1s",
19+
"neo4j.query.polling-duration": "5s"
20+
}
21+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "Neo4jSourceConnectorJSONString",
33
"config": {
44
"connector.class": "org.neo4j.connectors.kafka.source.Neo4jConnector",
5-
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
5+
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
66
"key.converter.schemas.enable": false,
7-
"value.converter": "org.apache.kafka.connect.storage.StringConverter",
7+
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
88
"value.converter.schemas.enable": false,
99
"neo4j.uri": "neo4j://neo4j:7687",
1010
"neo4j.authentication.type": "BASIC",

modules/ROOT/pages/source/cdc.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ include::example$docker-data/source.cdc.protobuf.json[]
9696
----
9797
=====
9898
99+
[.include-with-JSON-messages-with-embedded-schema]
100+
=====
101+
ifdef::backend-pdf[]
102+
.source.cdc.protobuf.json
103+
endif::[]
104+
[source,json]
105+
----
106+
include::example$docker-data/source.cdc.json-schema.json[]
107+
----
108+
=====
109+
99110
====
100111

101112
We will now create the source instance by invoking the following REST call:

modules/ROOT/pages/source/query.adoc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,36 @@ include::example$docker-data/source.query.json.json[]
5353
----
5454
=====
5555
56-
[.include-with-JSON-messages-as-string]
56+
[.include-with-PROTOBUF-messages]
5757
=====
5858
ifdef::backend-pdf[]
59-
.source.query.json-string.json
59+
.source.query.protobuf.json
6060
endif::[]
6161
[source,json]
6262
----
63-
include::example$docker-data/source.query.json-string.json[]
63+
include::example$docker-data/source.query.protobuf.json[]
6464
----
6565
=====
6666
67-
[.include-with-PROTOBUF-messages]
67+
[.include-with-JSON-messages-with-embedded-schema]
6868
=====
6969
ifdef::backend-pdf[]
70-
.source.query.protobuf.json
70+
.source.query.json-schema.json
7171
endif::[]
7272
[source,json]
7373
----
74-
include::example$docker-data/source.query.protobuf.json[]
74+
include::example$docker-data/source.query.json-schema.json[]
75+
----
76+
=====
77+
78+
[.include-with-JSON-messages-as-string]
79+
=====
80+
ifdef::backend-pdf[]
81+
.source.query.json-string.json
82+
endif::[]
83+
[source,json]
84+
----
85+
include::example$docker-data/source.query.json-string.json[]
7586
----
7687
=====
7788

0 commit comments

Comments
 (0)