Skip to content

Commit fa663a3

Browse files
Fixes #311: Documentation Improvement (#411)
1 parent da7f7a8 commit fa663a3

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ streams.sink.enabled.to.<DB_NAME>=<true/false, default=true>
8989
----
9090

9191
This means that for each db instance you can specify if:
92+
9293
* use the source connector
9394
* the routing patterns
9495

@@ -138,17 +139,17 @@ streams.sink.enabled=<true/false, default=true>
138139
This means that if you have Neo4j with 3 db instances:
139140

140141
* neo4j (default)
141-
* customers
142-
* products
142+
* foo
143+
* bar
143144

144145
and you want to enable the Sink plugin on all instance
145146
you can simply omit any configuration about enabling it, you just need to provide the routing configuration for each instance:
146147

147148
[source]
148149
----
149-
streams.sink.topic.cypher.customersTopic.to.customers=MERGE (c:Customer{customerId: event.customerId}) SET c += event.properties
150-
streams.sink.topic.cypher.productsTopic.to.products=MERGE (c:Product{productId: event.productId}) SET c += event.properties
151-
streams.sink.topic.cypher.productsTopic.to.neo4j=MERGE (c:MyLabel{myId: event.myId}) SET c += event.properties
150+
streams.sink.topic.cypher.fooTopic.to.foo=MERGE (f:Foo{fooId: event.fooId}) SET c += event.properties
151+
streams.sink.topic.cypher.barTopic.to.bar=MERGE (b:Bar{barId: event.barId}) SET c += event.properties
152+
streams.sink.topic.cypher.barTopic.to.neo4j=MERGE (c:MyLabel{myId: event.myId}) SET c += event.properties
152153
----
153154

154155
Otherwise if you want to enable the Sink plugin only on `customers` and `products` instances
@@ -157,10 +158,10 @@ you can do it in this way:
157158
[source]
158159
----
159160
streams.sink.enabled=false
160-
streams.sink.enabled.to.customers=true
161-
streams.sink.enabled.to.products=true
162-
streams.sink.topic.cypher.customersTopic.to.customers=MERGE (c:Customer{customerId: event.customerId}) SET c += event.properties
163-
streams.sink.topic.cypher.productsTopic.to.products=MERGE (c:Product{productId: event.productId}) SET c += event.properties
161+
streams.sink.enabled.to.foo=true
162+
streams.sink.enabled.to.bar=true
163+
streams.sink.topic.cypher.fooTopic.to.foo=MERGE (f:Foo{fooId: event.fooId}) SET c += event.properties
164+
streams.sink.topic.cypher.barTopic.to.bar=MERGE (b:Bar{barId: event.barId}) SET c += event.properties
164165
----
165166

166167
So in general if you have:

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

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ streams.source.enabled.from.<DB_NAME>=<true/false, default=true>
6161
----
6262

6363
This means that for each db instance you can specify if:
64+
6465
* use the source connector
6566
* the routing patterns
6667

@@ -104,28 +105,45 @@ streams.source.enabled=<true/false, default=true>
104105
This means that if you have Neo4j with 3 db instances:
105106

106107
* neo4j (default)
107-
* customers
108-
* products
108+
* foo
109+
* bar
109110

110-
and you want to enable the Source plugin on all instance
111+
and you want to enable the Source plugin on all instances,
111112
you can simply omit any configuration about enabling it, you just need to provide the routing configuration for each instance:
112113

113114
[source]
114115
----
115-
streams.source.topic.nodes.loginTopic=Login{userId}
116-
streams.source.topic.nodes.customerTopic.from.customers=Customer{customerId,name,surname}
117-
streams.source.topic.relationships.productTopic.from.products=Products{productId,name}
116+
streams.source.topic.nodes.testTopic=Test{testId}
117+
streams.source.topic.nodes.fooTopic.from.foo=Foo{fooId,fooName}
118+
streams.source.topic.relationships.barTopic.from.bar=Bar{barId,barName}
118119
----
119120

120-
Otherwise if you want to enable the Source plugin only on `customers` and `products` instances
121+
Otherwise if you want to enable the Source plugin only on `foo` and `bar` instances,
121122
you can do it in this way:
122123

123124
[source]
124125
----
125126
streams.source.enabled=false
126-
streams.source.enabled.from.customers=true
127-
streams.source.enabled.from.products=true
128-
streams.source.topic.nodes.loginTopic=Login{userId}
129-
streams.source.topic.nodes.customerTopic.from.customers=Customer{customerId,name,surname}
130-
streams.source.topic.relationships.productTopic.from.products=Products{productId,name}
127+
streams.source.enabled.from.foo=true
128+
streams.source.enabled.from.bar=true
129+
streams.source.topic.nodes.testTopic=Test{testId}
130+
streams.source.topic.nodes.fooTopic.from.foo=Foo{fooId,fooName}
131+
streams.source.topic.relationships.barTopic.from.bar=Bar{barId,barName}
131132
----
133+
134+
[NOTE]
135+
====
136+
As you can see, if you want to enable the Source plugin only on one or more specific db instances, you have to previously
137+
disable the Source plugin (`streams.source.enabled=false`) and then enable it only on the desired instances (i.e. `streams.source.enabled.from.foo=true`).
138+
Furthermore, please note that the `streams.source.topic.nodes.testTopic=Test{testId}` will not be considered because the Source plugin on the default database instance `neo4j` has been disabled.
139+
====
140+
141+
So in general if you have:
142+
143+
[source]
144+
----
145+
streams.source.enabled=true
146+
streams.source.enabled.from.foo=false
147+
----
148+
149+
Then Source module is enabled on all databases EXCEPT `foo` (local overrides global)

0 commit comments

Comments
 (0)