Skip to content

Commit 8b93c71

Browse files
Fixes #419: Neo4j Streams Source documentation improvement (#420)
1 parent 21142e7 commit 8b93c71

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

doc/docs/modules/ROOT/pages/producer-configuration.adoc

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,47 @@ streams.source.enabled=true
146146
streams.source.enabled.from.foo=false
147147
----
148148

149-
Then Source module is enabled on all databases EXCEPT `foo` (local overrides global)
149+
Then Source module is enabled on all databases EXCEPT `foo` (local overrides global)
150+
151+
[NOTE]
152+
====
153+
For example purposes only, imagine a situation like the following:
154+
155+
You have a Neo4j instance, without Neo4j Streams installed, where a database "testdb" was created and populated.
156+
You decide to install the Neo4j Streams plugin because we want to have also our graph data into Kafka.
157+
So you add the following configuration:
158+
159+
[source]
160+
----
161+
kafka.zookeeper.connect=localhost:2181
162+
kafka.bootstrap.servers=localhost:9092
163+
streams.source.enabled=true
164+
streams.sink.enabled=false
165+
streams.procedures.enabled=true
166+
streams.source.topic.nodes.topicTest.from.testdb=Test{*}
167+
----
168+
169+
Doing so you expect to reflect all the created/updated nodes with label `Test` into the topic `topicTest`.
170+
What actually happens is:
171+
172+
- all the nodes and relationship inserted before the Kafka setup, are reflected into a topic called "testdb" which is created by default with the database name.
173+
- all the created/updated nodes with label `Test`, after the Kafka setup, are reflected into the configured topic `topicTest`.
174+
175+
The second point happens because, since the database "testdb" is already populated, by enabling the Source module (`streams.source.enabled=true`) the plugin will create a default topic with the same name as the database name, and it will reflect all the "testdb" data into it.
176+
177+
If you want to turn off this default behaviour you have to disable the "generic" Source module and enable it just for the
178+
database you are interested of:
179+
180+
[source]
181+
----
182+
kafka.zookeeper.connect=localhost:2181
183+
kafka.bootstrap.servers=localhost:9092
184+
streams.source.enabled=false
185+
streams.sink.enabled=false
186+
streams.procedures.enabled=true
187+
streams.source.enabled.from.test1=true
188+
streams.source.topic.nodes.topicTest.from.testdb=Test{*}
189+
----
190+
191+
====
192+

0 commit comments

Comments
 (0)