EventStore JVM client, subscriptions, and reconnects

Hi guys,

I’m just starting to write my EventStore Java client, using the JVM Akka library. It’s working okish, but there’s a shocking lack of example code on how to use it.

Right now the most pressing question is this: if the connection is lost (“Connection lost to localhost/127.0.0.1:1113: no heartbeat within 2 seconds”), what is the correct way to reconnect or resubscribe? I only have one subscriber, for the “all streams”, but have no idea how to get it running again. Trying to resubscribe in SubscriptionObserver.onClose causes another exception (“java.lang.IllegalStateException: cannot create children while terminating or terminated”).

Are there any other Java developers out there who have handled this already?

thanks, Rickard

Hi Rickard,

Client will reconnect on its own, some related settings you can find in reference.conf

Thanks Yaroslav! I think my problem was that I copied the Java writer
example, without looking into what it actually did. It terminated the
actor system, which is probably what caused my issues.

/Rickard