# Neo4j apoc.periodic.repeat doesn't work with streams.publish

**URL:** https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313
**Category:** Procedures & APOC
**Tags:** neo4j-streams
**Created:** [November 27, 2019, 7:12pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313 "2019-11-27T19:12:13Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [November 27, 2019, 7:12pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/1 "2019-11-27T19:12:13Z")

</div>

Does anyone ever used Neo4j apoc.periodic.repeat function to publish message to kafka? Here is what I have now:

I have a working query to send message to my kafka topic:

```auto
CALL streams.publish("my-neo4j-topic", "Hello World from Neo4j!")

```

However, when I used apoc repeat function:

```auto
CALL apoc.periodic.repeat('kafka-only',
    'CALL streams.publish("my-neo4j-topic", "Hello World from Neo4j!")', 5)

```

Nothing happens..

I have checked the log/debug log and can't get any hint. Can anyone help me?

This is my configuration:

```auto
kafka.zookeeper.connect=localhost:2181
kafka.bootstrap.servers=localhost:9092
streams.procedures.enabled=true
streams.source.enabled=true
streams.source.schema.polling.interval=10000
dbms.security.procedures.unrestricted=apoc.*

```

Please provide the following information if you ran into a more serious issue:

- neo4j version: neo4j-community-3.4.17
- desktop version : MacOS 10.12.6
- which plugins / extensions / procedures do you use : apoc-3.4.0.7-all.jar and neo4j-streams-3.4.4.jar
- neo4j.log and debug.log : No exceptions and no logs

---

<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: [November 27, 2019, 10:17pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/2 "2019-11-27T22:17:57Z")

</div>

Can you be more specific on nothing happens? You don't see the messages going to Kafka, or you don't get any results from APOC?

What happens if you call streams.publish() by itself without the APOC?

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [November 28, 2019, 2:24am UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/3 "2019-11-28T02:24:43Z")

</div>

When I use APOC procedure then I don't see the messages getting publish to Kafka topic.  
If i call streams.publish() without APOC in that case message is getting published in Kafka topic.

---

<div class="post-metadata">

### Author: ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)
#### Post date: [November 29, 2019, 4:07pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/4 "2019-11-29T16:07:36Z")

</div>

Could you try to reproduce with a 3.5.12 setup and appropriate more current apoc + streams versions?

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [November 30, 2019, 1:15am UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/5 "2019-11-30T01:15:13Z")

</div>

Yes, I tried to reproduce with 3.5.12 version and it has same issue.  
streams.publish without apoc producer is publishing message in Kafka topic.

```auto
CALL streams.publish("my-neo4j-topic", "Hello World from Neo4j!")

```

Below query with apoc job management procedure is not publishing message in Kafka topic.

```auto
CALL apoc.periodic.repeat('kafka-only',
    'CALL streams.publish("my-neo4j-topic", "Hello World from Neo4j!")', 5)

```

---

<div class="post-metadata">

### Author: ![conker84](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/conker84/32/275_2.png) [@conker84](https://community.neo4j.com/u/conker84)
#### Post date: [December 2, 2019, 2:11pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/6 "2019-12-02T14:11:09Z")

</div>

Thanks @kavitakjava please try with the following jar:

> **[Dropbox - File Deleted](https://www.dropbox.com/s/lh88ncvxyb2178j/neo4j-streams-3.5.4.jar?dl=0)**
>
> Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

I look forward to your feedback.  
Thanks a lot  
Andrea

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [December 2, 2019, 4:32pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/7 "2019-12-02T16:32:31Z")

</div>

Hi Andrea @conker84,

The jar which you provided worked with neo4j-community-3.5.13 and i can see messages published every 5 seconds in the Kafka topic !!

The jar from [Release 3.5.4 · neo4j-contrib/neo4j-streams · GitHub](https://github.com/neo4j-contrib/neo4j-streams/releases/tag/3.5.4) did not worked.

Seems like you have some fixes in ur jar.  
Can this be available on github?

Your fix worked! Thank you so much for your help!

Best,  
Kavita

---

<div class="post-metadata">

### Author: ![conker84](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/conker84/32/275_2.png) [@conker84](https://community.neo4j.com/u/conker84)
#### Post date: [December 2, 2019, 4:35pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/8 "2019-12-02T16:35:27Z")

</div>

Yes I fixed the bug in that jar. I'm preparing a PR so it'll be available with the next release.  
Thanks a lot for pointing this out!

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [December 2, 2019, 4:36pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/9 "2019-12-02T16:36:28Z")

</div>

Awesome!  
I'm glad that my use case helped to brought up this issue !

Will this fix available for previous releases e.g. 3.4.17 so that we might now have to upgrade the version in production?

---

<div class="post-metadata">

### Author: ![conker84](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/conker84/32/275_2.png) [@conker84](https://community.neo4j.com/u/conker84)
#### Post date: [December 19, 2019, 8:40am UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/10 "2019-12-19T08:40:32Z")

</div>

@kavitakjava sorry for the delay, do you think it's an option upgrade Neo4j to v 3.5.13?  
Please lemme know otherwise we have to find an alternative to support you.  
Thanks a lot

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [January 21, 2020, 4:55pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/11 "2020-01-21T16:55:14Z")

</div>

Hi @conker84,

Has this issue fixed got in the latest release? We can upgrade to the latest release in prod.  
Thank you!

Best,  
Kavita

---

<div class="post-metadata">

### Author: ![conker84](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/conker84/32/275_2.png) [@conker84](https://community.neo4j.com/u/conker84)
#### Post date: [January 24, 2020, 10:10am UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/12 "2020-01-24T10:10:41Z")

</div>

HI @kavitakjava we did a new release yesterday that contains the fix:

> **[Release 3.5.5 · neo4j-contrib/neo4j-streams](https://github.com/neo4j-contrib/neo4j-streams/releases/tag/3.5.5)**
>
> Hello Neo4j Community!
> We're very happy to present the new 3.5.5 release of the Neo4j Kafka integrations, that is the result of great community feedback!
> Thanks a lot to everyone who contributed to...

---

<div class="post-metadata">

### Author: ![kavitakjava](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kavitakjava/32/4545_2.png) [@kavitakjava](https://community.neo4j.com/u/kavitakjava)
#### Post date: [January 24, 2020, 4:17pm UTC](https://community.neo4j.com/t/neo4j-apoc-periodic-repeat-doesnt-work-with-streams-publish/12313/13 "2020-01-24T16:17:42Z")

</div>

> [@conker84](#):
>
> neo4j-contrib/neo4j-streams

Awesome!!  
Thank you so much @conker84
