Hi, 


Now I have gone through Persistence Query 
<http://doc.akka.io/docs/akka/snapshot/java/persistence-query.html>, 
akka-sample 
<https://github.com/akka/akka/tree/master/akka-samples/akka-sample-persistence-java>
 
and akka-doc 
<https://github.com/akka/akka/tree/master/akka-docs/rst/java/code/docs/persistence>
 
and still need help setting up a PersistenceQuery. 

Do anyone know if there is an example that shows this in a simple manner 
implemented in java?

I have managed to persist the different events, but not able to list them 
when reading journal. Here are my poc code:


public static void main(String... args) throws Exception {
    ActorSystem system = ActorSystem.create("example");
    ActorRef persistentActor = 
system.actorOf(Props.create(ApplicationIsStartingPersistenceActor.class), 
"persistentActor-4-java");

    persistentActor.tell(new ApplicationIsStartingCommand(), null);
    
    Thread.sleep(1000);

    LeveldbReadJournal readJournal = 
PersistenceQuery.get(system).getReadJournalFor(LeveldbReadJournal.class, 
LeveldbReadJournal.Identifier());

    Source<EventEnvelope, BoxedUnit> source = 
readJournal.eventsByPersistenceId("persistentActor-4-java", 0, Long.MAX_VALUE);
    source.runForeach(event -> System.out.println("Event: " + event), 
ActorMaterializer.create(system));
    
    system.terminate();
}


Any obvious errors?

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to