EventStore.Akka.Persistence icon indicating copy to clipboard operation
EventStore.Akka.Persistence copied to clipboard

Querying streams

Open revati opened this issue 8 years ago • 2 comments

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) }

revati avatar Nov 14 '15 15:11 revati

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

t3hnar avatar Nov 14 '15 15:11 t3hnar

Thanks, now it is working :)

Are there any plans to update documentation?

revati avatar Nov 14 '15 15:11 revati