Quickstart: choose a source strategy

The source connector takes data out of Neo4j and publishes it to Kafka: the database is the producer, and something else consumes. Which strategy you use depends on whether you need every change or a specific projection. Each quickstart below is self-contained and runnable on a local Docker stack.

If you want the other direction — Kafka messages written into Neo4j — see Quickstart: choose a sink strategy.

Source: getting Neo4j changes into Kafka

Your situation Strategy Quickstart

You need every change, including deletes, in near real time, without changing your graph model.

Change Data Capture — Neo4j’s own change feed.

Source with CDC

You want a specific projection, you are on Community Edition, or you cannot enable CDC.

Query — your Cypher query, polled on an interval.

Source with Query

Two differences decide it in most cases:

  • Deletes. A polling query cannot see a node that no longer exists. Only CDC reports deletes, unless you adopt soft deletes.

  • Edition. CDC needs Enterprise Edition or Aura Enterprise. Query works anywhere.

What every quickstart assumes

All of them run the same local stack — Neo4j, a Kafka broker, Kafka Connect and Schema Registry via Docker Compose — and differ only in connector configuration and message shape. So it is reasonable to work through one, then swap the connector to try another.

Serialization differs by strategy, and it is the detail most likely to trip you up:

Strategy Serialization

Change Data Capture, Query

Always produces messages with schemas. A schemaless converter will not work.

Where a schema is required, these guides use JsonConverter with schemas.enable=true, which embeds the schema in each message and needs no Schema Registry. Avro and Protobuf are covered on each page, and in Schema Registry.

Deploying somewhere other than Docker

The strategy guides use a local Docker Compose stack so they can be run start to finish. The strategy configuration is identical wherever you deploy it — only installation and connection details change: