Warning
DEPRECATION NOTICE:
- EventStoreDB version 23.10.x is the last OSS version to support the tcp protocol based client.
- This project is no longer maintained. We recommend moving to EventStoreDB-Client-Java for ongoing updates and support.
Akka Persistence journal and snapshot-store backed by EventStoreDB.
Scala | 3.1.0 / 2.13.7 / 2.12.15 |
Akka | 2.6.18 |
EventStore client | 8.0.1 |
To use this plugin prior default one, add the following to application.conf
:
akka.persistence {
journal.plugin = eventstore.persistence.journal
snapshot-store.plugin = eventstore.persistence.snapshot-store
}
To configure EventStore.JVM client, see it's reference.conf
Akka serializes your messages into binary data by default.
However you can add your own serializer to serialize as JSON,
But make sure you extend akka.persistence.eventstore.EventStoreSerializer
rather then akka.serialization.Serializer
.
And in case you are really going to serialize as json, please specify ContentType.Json
, it will allow you to use projections.
trait EventStoreSerializer extends Serializer {
def toEvent(o: AnyRef): EventData
def fromEvent(event: Event, manifest: Class[_]): AnyRef
}
Please check out some real examples used in tests:
libraryDependencies += "com.geteventstore" %% "akka-persistence-eventstore" % "8.0.1"
<dependency>
<groupId>com.geteventstore</groupId>
<artifactId>akka-persistence-eventstore_${scala.version}</artifactId>
<version>8.0.0</version>
</dependency>