Automatically create checkpoint file
First of all, thank you for this great tool. I was able to do a successful replication in my test environment. There were some hick-ups though regarding checkpoints.
A simplified docker-compose.yml
version: '3.7'
services:
eventstore-replicator:
container_name: eventstore-replicator
image: eu.gcr.io/esc-platform-advocacy/eventstore/replicator:latest
ports:
- "5000:5000"
volumes:
- ./replicator.yml:/app/config/appsettings.yaml
- ./checkpoint:/app/checkpoint
"checkpoint" is mounted into the container, to make it survive a container restart.
replicator.yml
...
checkpoint:
path: "/app/checkpoint"
At first I faced a "permission denied". It turned out that the application expected "checkpoint" to be a file, not a directory. This is mentioned in the docs under "Concepts". What is not mentioned, is that the application expects a StreamPosition, e.g. "0,0". I found that out after getting FormatExceptions because appearantly the constructor of EventStore.Replicator.FileCheckpointStore checks if the file exists, and if not, creates it with content "test" --> conversion to int fails.
The fix was to manually create a checkpoint file and put "0,0" into it.
I'm wondering how it works, if one doesn't manually create the file with proper content before starting the application, and I'm unsure whether this is a bug/feature request.
One thing to improve for sure though is to add replicator.checkpoint.path to the configuration section in the docs.
If you want to start from the beginning, you can just have no file. I will update the docs though, thank you for the heads up.