Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Querying streams #20

Open
revati opened this issue Nov 14, 2015 · 2 comments
Open

Querying streams #20

revati opened this issue Nov 14, 2015 · 2 comments

Comments

@revati
Copy link

revati commented Nov 14, 2015

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) }
@t3hnar
Copy link
Contributor

t3hnar commented Nov 14, 2015

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

@revati
Copy link
Author

revati commented Nov 14, 2015

Thanks, now it is working :)

Are there any plans to update documentation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants