Java apoc.periodic.iterate( {params:{...}}) insert large scale of data


I'm trying to execute the following Java code with apoc without success.
Can somebody assist me?

public interface IRelationRepository {

    @Query("call apoc.periodic.iterate("
            + "\"UNWIND $items as item return item "
            + "MERGE (s1:s{id:item.startNode.customId}) "
            + "WITH s1 "
            + "MERGE (e1:e{id:item.endNode.customId}) "
            + "MERGE (s1)-[r:item.type]->(e1) "
            + "RETURN r\", "
            + "\"SET,\", "
            + "{batchSize:5000, parallel:true, iterateList:true, params:{items:$items}})")
    Result saveAll(@Param("items") List<?> items);

I also tried using:

            + "{batchSize:5000, parallel:true, iterateList:true, params:{items:{items}}})")

In general, what I want to do is to insert a large scale of data into Neo4j.
The solution I found is using apoc.periodic.iterate(...).
I saw examples in which load csv/json is being used. In my case scenario, I'm building the objects in the code. So to insert those objects into a CSV file seems to be a redundant (and expensive) step.

BTW, I saw the following topic:

and saw @michael.hunger replays there and in someplace over the web.
So if you can assist, it will be fantastic.

The errors I'm receiving:

2020-11-16T10:24:43,792 ERROR [grpc-default-executor-0] i.g.i.SerializingExecutor: Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@4950d342
java.lang.IllegalArgumentException: Infinite recursion (StackOverflowError) (through reference chain:["countersMap"]->["countersMap"]- ...
	at com.fasterxml.jackson.databind.ObjectMapper._convert(
	at com.fasterxml.jackson.databind.ObjectMapper.convertValue(

Thanks in advance,