EventStore.Akka.Persistence
EventStore.Akka.Persistence copied to clipboard
Querying streams
Hello, i can not figure this out.
How exactly should currentPersistenceIds
and allPersistenceIds
methods be used?
In code example below i can fetch events from eventstore, but i can't fetch any stream :(
val readJournal = PersistenceQuery(system).readJournalFor[EventStoreReadJournal](EventStoreReadJournal.Identifier)
// Events from specific stream
val source: Source[EventEnvelope, Unit] = readJournal.eventsByPersistenceId("contents", 0, Long.MaxValue)
source.runForeach { event => println("Event: " + event) }
// Streams
val source2: Source[String, Unit] = readJournal.currentPersistenceIds()
source2.runForeach { stream => println("Stream: " + stream) }
Hi @revati
Sorry for lack of docs on this. currentPersistenceIds
& allPersistenceIds
require projections enabled on eventstore, you can enable this by running eventstore with additional command line argument --run-projections=all
and then make sure you have streams
enabled via web interface like: http://prntscr.com/92o7au
Thanks, now it is working :)
Are there any plans to update documentation?