[akka-user] Re: Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Jan-Terje Sørensen
That is the pom.xml file for transforming the config file.

onsdag 2. august 2017 22.50.51 UTC+2 skrev Evgeny Shepelyuk følgende:
>
> Wtf is this XMl snippet ?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Jan-Terje Sørensen
Just figured it out. Filename should be "application.conf" as you stated. 
And the transformer name should be "reference.conf"


reference.conf


-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Jan-Terje Sørensen
If I change to application.conf then I get this error because 
reference.conf is missing:

INFO  [2017-08-02 20:36:38,089] akka.event.slf4j.Slf4jLogger: Slf4jLogger 
started
requirement failed: 'reference.conf' is missing persistence read journal 
plugin config path: 'akka.persistence.query.journal.leveldb'
INFO  [2017-08-02 20:36:38,130] akka.actor.CoordinatedShutdown: Starting 
coordinated shutdown from JVM shutdown hook
ERROR [2017-08-02 20:36:38,133] akka.actor.OneForOneStrategy: No 
configuration setting found for key 'max-concurrent-recoveries'
! com.typesafe.config.ConfigException$Missing: No configuration setting 
found for key 'max-concurrent-recoveries'
! at 
com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
! at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
! at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
! at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
! at 
com.typesafe.config.impl.SimpleConfig.getConfigNumber(SimpleConfig.java:219)
! at com.typesafe.config.impl.SimpleConfig.getInt(SimpleConfig.java:230)
! at akka.persistence.Persistence.(Persistence.scala:156)
! at akka.persistence.Persistence$.createExtension(Persistence.scala:131)
! at akka.persistence.Persistence$.createExtension(Persistence.scala:128)
! at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:880)
! at akka.actor.ExtensionId$class.apply(Extension.scala:77)
! at akka.persistence.Persistence$.apply(Persistence.scala:128)
! at akka.persistence.Eventsourced$class.$init$(Eventsourced.scala:51)
! at 
akka.persistence.AbstractPersistentActor.(PersistentActor.scala:409)
! at 
no.jansoren.akka.persistence.eventsourcing.EventSourcedPersistenceActor.(EventSourcedPersistenceActor.java:14)
! at 
no.jansoren.eventsourcing.PersistenceActor.(PersistenceActor.java:17)
! ... 18 common frames omitted
! Causing: java.lang.reflect.InvocationTargetException: null
! at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
! at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
! at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
! at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
! at akka.util.Reflect$.instantiate(Reflect.scala:65)
! at 
akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
! at akka.actor.Props.newActor(Props.scala:213)
! at akka.actor.ActorCell.newActor(ActorCell.scala:563)
! at akka.actor.ActorCell.create(ActorCell.scala:589)
! ... 9 common frames omitted
! Causing: akka.actor.ActorInitializationException: 
akka://actor-system/user/PersistenceActor: exception during creation
! at akka.actor.ActorInitializationException$.apply(Actor.scala:191)
! at akka.actor.ActorCell.create(ActorCell.scala:608)
! at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:462)
! at akka.actor.ActorCell.systemInvoke(ActorCell.scala:484)
! at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
! at akka.dispatch.Mailbox.run(Mailbox.scala:223)
! at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
! at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
! at 
akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
! at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
! at 
akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
  



onsdag 2. august 2017 21.47.42 UTC+2 skrev Evgeny Shepelyuk følgende:
>
> May I assume that you should use `application.conf` in your code, not 
> `reference.conf` as you've mentioned in the post.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Jan-Terje Sørensen
Hi,

I am working on getting my akka-persistence app to run in Docker. When I 
run the application from Intellij it works as intended, but when i deploy 
the same files(jar & config) to Docker and try to run it from the container 
i get this error: 
```
[ERROR] [08/02/2017 11:04:10.226] 
[actor-system-akka.actor.default-dispatcher-2] 
[akka://actor-system/user/PersistenceActor] requirement failed: default 
journal plugin is not configured, see 'reference.conf'
akka.actor.ActorInitializationException: 
akka://actor-system/user/PersistenceActor: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:191)
at akka.actor.ActorCell.create(ActorCell.scala:608)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:462)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:484)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at 
akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at 
akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at 
akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at akka.util.Reflect$.instantiate(Reflect.scala:65)
at 
akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:563)
at akka.actor.ActorCell.create(ActorCell.scala:589)
... 9 more
Caused by: java.lang.IllegalArgumentException: requirement failed: default 
journal plugin is not configured, see 'reference.conf'
at scala.Predef$.require(Predef.scala:224)
at 
akka.persistence.Persistence.defaultJournalPluginId$lzycompute(Persistence.scala:163)
at 
akka.persistence.Persistence.defaultJournalPluginId(Persistence.scala:161)
at 
akka.persistence.Persistence.journalConfigFor(Persistence.scala:239)
at akka.persistence.Eventsourced$class.$init$(Eventsourced.scala:61)
at 
akka.persistence.AbstractPersistentActor.(PersistentActor.scala:409)
at 
no.jansoren.akka.persistence.eventsourcing.EventSourcedPersistenceActor.(EventSourcedPersistenceActor.java:14)
at 
no.jansoren.eventsourcing.PersistenceActor.(PersistenceActor.java:21)
... 18 more
```

My `reference.conf` file looks like this:

```
akka {
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  loglevel = "DEBUG"
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"

  persistence {
journal {
  plugin = "akka.persistence.journal.leveldb"
  leveldb.dir = "target/journal"
}
snapshot-store {
  plugin = "akka.persistence.snapshot-store.local"
  local.dir = "target/snapshots"
}
  }
  actor {
warn-about-java-serializer-usage = false
  }
}
```

Any suggestions on how to attack this issue?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Receive value from persistenceActor.tell (msg, send);

2017-07-07 Thread Jan-Terje Sørensen
Hi,

I have a API where I want to create a new user, and as a result of this 
API-call i would like to return the User-ID.
How is it possible to receive a value from a tell? I have looked into 
Futures with no luck. I am trying to avoid Await.result, and solve it with 
a onSuccess. Anyone have a good code example?


-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: How to create a good persistence actor test in java

2016-03-07 Thread Jan-Terje Sørensen
I found a solution for a simple way to setup my unit tests. You can find 
the result here - akka-persistence-java-example 
<https://github.com/jansoren/akka-persistence-java-example/blob/master/src/test/java/no/jansoren/akka/persistence/eventsourcing/EventSourcedPersistenceActorTest.java#L27>

onsdag 2. mars 2016 22.24.42 UTC+1 skrev Jan-Terje Sørensen følgende:
>
> Hi,
>
> I'm working on figuring out how to create a good persistence actor test in 
> java but am struggling with the example 
> <http://doc.akka.io/docs/akka/snapshot/java/testing.html>. 
> This is my unit-test code 
> <https://github.com/jansoren/akka-persistence-java-example/commit/5a936bad23271d49083cf69dbbac68c0ce311dd3>.
>  
> Any suggestions to where to debug?
>
> Best regards
> Jan-Terje Sørensen
>

-- 
>>>>>>>>>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How to create a good persistence actor test in java

2016-03-02 Thread Jan-Terje Sørensen
Hi,

I'm working on figuring out how to create a good persistence actor test in 
java but am struggling with the example 
<http://doc.akka.io/docs/akka/snapshot/java/testing.html>. 
This is my unit-test code 
<https://github.com/jansoren/akka-persistence-java-example/commit/5a936bad23271d49083cf69dbbac68c0ce311dd3>.
 
Any suggestions to where to debug?

Best regards
Jan-Terje Sørensen

-- 
>>>>>>>>>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Separate my command handling

2016-02-25 Thread Jan-Terje Sørensen
I have refactored the code. Can someone please comment and see if I am on 
to something, EventSourcedPersistenceActor.java 

? 



-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Separate my command handling

2016-02-24 Thread Jan-Terje Sørensen


Hi,


As I understand the persistence examples 

 they all end up with all the command handling in one persistence actor. Is it 
possible to separate this in different command handlers, and still have the 
same persistence id?


This is the file i want to separate - akka-persistence-java-example 


-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: PersistenceQuery.ReadJournal vs PersistentActor.onReceiveRecover

2016-01-04 Thread Jan-Terje Sørensen
Thanks for the clarification :)

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Projecting the events from a PersistenceQuery

2016-01-04 Thread Jan-Terje Sørensen
This is how i solved it - EventStore.java 

 
and Projection.java 


-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Projecting the events from a PersistenceQuery

2016-01-04 Thread Jan-Terje Sørensen
This is how i solved it for this example 

!

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: PersistenceQuery.ReadJournal vs PersistentActor.onReceiveRecover

2016-01-01 Thread Jan-Terje Sørensen
Do you have a domain example of when this is usefull? 

torsdag 31. desember 2015 15.33.15 UTC+1 skrev Jan-Terje Sørensen følgende:
>
> Hi,
>
> Both PersistenceQuery.ReadJournal and PersistentActor.onReceiveRecover 
> handles events. 
>
> As I understand it we shall always use PersisteceQuery when projecting our 
> data. Can anyone please explain when I need to use the 
> PersistentActor.receiveRecover?
>

-- 
>>>>>>>>>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] PersistenceQuery.ReadJournal vs PersistentActor.onReceiveRecover

2015-12-31 Thread Jan-Terje Sørensen
Hi,

Both PersistenceQuery.ReadJournal and PersistentActor.onReceiveRecover 
handles events. 

As I understand it we shall always use PersisteceQuery when projecting our 
data. Can anyone please explain when I need to use the 
PersistentActor.receiveRecover?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Akka PersistenceQuery java example

2015-12-26 Thread Jan-Terje Sørensen
Does that mean that if I depend on the order of different events they 
should all have the same persistentId?

lørdag 26. desember 2015 13.15.05 UTC+1 skrev Patrik Nordwall følgende:
>
> Each PersistentActor instance has a unique persistenceId. A 
> PersistentActor instance can persist different types of events.
>
> On Fri, Dec 25, 2015 at 3:24 PM, Jan-Terje Sørensen <jtbso...@gmail.com 
> > wrote:
>
>> Aha! I did not know that different events could have same persistenceId. 
>> Is the persistenceId the same as an aggregate then?
>>
>> -- 
>> >>>>>>>>>> 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 akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
>

-- 
>>>>>>>>>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-25 Thread Jan-Terje Sørensen
Thanks Patrik, you where correct. 

Now that I have confirmed that my events are persisted. How do I use it in 
an object that extends a PersistenceQuery? And how do I read different 
types of events (different persistence id) in same persistence query?
For example, NewCustomerEstablishedEvent, PhoneNumberChangedEvent.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-25 Thread Jan-Terje Sørensen
Thanks Patrik, you where correct. 

Now that I have confirmed that my events are persisted. How do I use it in 
an object that extends a PersistenceQuery? And how do I read different 
types of events (different persistence id) in same persistence query?
For example, NewCustomerEvent, ChangePhoneNumberEvent.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-25 Thread Jan-Terje Sørensen
Aha! I did not know that different events could have same persistenceId. Is 
the persistenceId the same as an aggregate then?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-24 Thread Jan-Terje Sørensen
Any suggestion on how to solve it?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-24 Thread Jan-Terje Sørensen
The thing that is not working is to read the events from the journal.

You can the se work in progress code here 

.

This is how i persist my events:

public class ApplicationIsStartingPersistenceActor extends 
UntypedPersistentActor {

@Override
public String persistenceId() {
return "sample-id-1";
}

@Override
public void onReceiveRecover(Object msg) throws Exception {
System.out.println("onReceiveRecover: " + msg);
}

@Override
public void onReceiveCommand(Object msg) throws Exception {
System.out.println(msg);
if (msg instanceof ApplicationIsStartingCommand) {
ApplicationHasStartedEvent event = new ApplicationHasStartedEvent();
persist(event, new Procedure() {
@Override
public void apply(ApplicationHasStartedEvent event1) throws 
Exception {
if (event.equals(event1)) {
getContext().system().eventStream().publish(event1);
}
}
});
} else {
unhandled(msg);
}
}
}



-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka PersistenceQuery java example

2015-12-24 Thread Jan-Terje Sørensen
I have tryed with setting same id's, but still not able to list events.

Are you able to show some code on how to solve this?  

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Akka PersistenceQuery java example

2015-12-23 Thread Jan-Terje Sørensen


Hi, 


Now I have gone through Persistence Query 
, 
akka-sample 

 
and akka-doc 

 
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 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.