How to produce and consume Kafka data streams directly via Cypher with Streams Procedures

Leveraging Neo4j Streams — Part 3

Andrea Santurbano
May 9 · 3 min read

What is a Neo4j Stored Procedure?

What are the streams procedures?

Set-Up the Environment

$ docker-compose up

streams.publish

CALL streams.publish('my-topic', 'Hello World from Neo4j!')
{"payload": "Hello world from Neo4j!"}
The streams.publish procedure in action

streams.consume

CALL streams.consume('my-topic', {<config>}) YIELD event RETURN event
{"name": "Andrea", "surname": "Santurbano"}
CALL streams.consume('my-topic', {<config>}) YIELD event
CREATE (p:Person{firstName: event.data.name, lastName: event.data.surname})
The stream.consume procedure in action

freeCodeCamp.org

This is no longer updated. Go to https://freecodecamp.org/news instead

Thanks to Michael Hunger.

Andrea Santurbano

Written by

Data Lover @AgileLARUS

freeCodeCamp.org

This is no longer updated. Go to https://freecodecamp.org/news instead