# Neo4j Kafka Source Plugin: Re- publish everything without losing data

**URL:** https://community.neo4j.com/t/neo4j-kafka-source-plugin-re-publish-everything-without-losing-data/43034
**Category:** Streaming (Kafka, Spark, Flink)
**Created:** [August 17, 2021, 1:59pm UTC](https://community.neo4j.com/t/neo4j-kafka-source-plugin-re-publish-everything-without-losing-data/43034 "2021-08-17T13:59:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![average\_legend](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/average_legend/32/4625_2.png) [@average\_legend](https://community.neo4j.com/u/average_legend)
#### Post date: [August 17, 2021, 1:59pm UTC](https://community.neo4j.com/t/neo4j-kafka-source-plugin-re-publish-everything-without-losing-data/43034/1 "2021-08-17T13:59:37Z")

</div>

Hi. I am using Neo4j 4.2.3 together with the `neo4j-streams-4.0.8` Plugin to stream Neo4j CDC events to a kafka topic. Works okay so far.

Here is the question: It is quite possible that in some cases I lose everything what's in the topic (due to non-Kafka or non-Neo4j related events). In this case I need to get all the data of Neo4j back into the now empty topic. Is it possible to do it without altering all the nodes/relationships?

Thank you!

---

<div class="post-metadata">

### Author: ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)
#### Post date: [August 19, 2021, 9:10pm UTC](https://community.neo4j.com/t/neo4j-kafka-source-plugin-re-publish-everything-without-losing-data/43034/2 "2021-08-19T21:10:38Z")

</div>

neo4j-streams has a stored procedure `CALL streams.publish(topic, message)`. You can see the docs here:

> **[Kafka Connect Neo4j Connector User Guide - Neo4j Kafka Integration Docs](https://neo4j.com/docs/kafka/)**

You could combine this with APOC to re-publish everything in your database if you wished, something like:

```auto
CALL apoc.periodic.iterate('MATCH (p:Person) RETURN p', 'CALL streams.publish("my-topic", { name: p.name }), { parallel: false });

```

This is an answer to your question, but honestly -- it is also possible to configure durability on the kafka topic itself. So if kafka is correctly configured, I would hope this situation would not arise.
