Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Neo4j Kafka Cluster
### Neo4j.conf
kafka.zookeeper.connect=172.xx.xx.xx:2181
kafka.bootstrap.servers=172.xx.xx.xx:9092
streams.sink.enabled=true
streams.sink.polling.interval=1000
streams.sink.topic.cypher.Neo4jPersonTest=MERGE (p:Person{name: event.name, surname: event.surname}) MERGE (f:Family{name: event.surname}) MERGE (p)-[:BELONGS_TO]->(f)
streams.sink.topic.cypher.blogpost_maxmind_albums=FOREACH(ignoreMe IN CASE WHEN event.type='insert' THEN [1] ELSE [] END | MERGE (c:Album{id:event.data.id}) on match set c.name = event.data.name on create set c.name = event.data.name) FOREACH(ignoreMe IN CASE WHEN event.type='delete' THEN [1] ELSE [] END | MERGE (c:Album{id:event.data.id}) detach delete c) FOREACH(ignoreMe IN CASE WHEN event.type='update' THEN [1] ELSE [] END | MERGE (c:Album{id:event.data.id}) set c.name=event.data.name, c.genre=event.data.genre)
streams.sink.topic.cypher.blogpost_maxmind_users=FOREACH(ignoreMe IN CASE WHEN event.type='insert' THEN [1] ELSE [] END | MERGE (u:User{id:event.data.id}) on match set u.name = event.data.name on create set u.name = event.data.name) FOREACH(ignoreMe IN CASE WHEN event.type='delete' THEN [1] ELSE [] END | MERGE (u:User{id:event.data.id}) detach delete u) FOREACH(ignoreMe IN CASE WHEN event.type='update' THEN [1] ELSE [] END | MERGE (u:User{id:event.data.id}) set u.name=event.data.name)
kafka.auto.offset.reset=earliest
kafka.group.id=neo4j
streams.sink.dlq=person-dlq
#streams.source.topic.nodes.nodechange=Product{*};Team{*}
#streams.source.enabled=true
kafka.acks=all
kafka.num.partitions=1
kafka.retries=2
kafka.batch.size=16384
kafka.buffer.memory=33554432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.