[akka-user] respondWithHeader and rejections

2017-10-19 Thread Jelmer Kuperus
In akka http I am using the respondWithHeader directive to add a correlation id to the response like so final case class `X-Request-Id`(token: String) extends ModeledCustomHeader[`X-Request-Id`] { override def renderInRequests = true override def renderInResponses = true override val

Re: [akka-user] Need of `onRecoveryCompleted` in akka typed for persistence

2017-10-19 Thread Yaroslav Klymko
On Thursday, October 19, 2017 at 9:33:59 PM UTC+2, Patrik Nordwall wrote: > > Invalid events must not be stored, because then the actor will not be able > to recover after a restart (later startup). Validation should typically be > done by validating the incoming command before persisting the

Re: [akka-user] Need of `onRecoveryCompleted` in akka typed for persistence

2017-10-19 Thread Patrik Nordwall
Invalid events must not be stored, because then the actor will not be able to recover after a restart (later startup). Validation should typically be done by validating the incoming command before persisting the event. Validation should not be placed in applyEvent, but as an additional protection

[akka-user] Re: Actors Initialization order.

2017-10-19 Thread Hsnamed
I have business objects tree which i receive from from datasource. Each element of tree is node where T is business object type, on the same level of tree T-types are same. Then i traverse the tree for warm up/build actor system, pass to actor constructor business object T and list of children

[akka-user] Re: Actors Initialization order.

2017-10-19 Thread Tal Pressman
Hi, Can you clarify a bit what you're trying to do? Are the children and grandchildren supposed to be Actors? What's a Node? Generally speaking, if you want actor1 to be actor2's parent, then actor1 has to be the one creating actor2. Even then, all actor1 will have is an ActorRef, not a

[akka-user] Actors Initialization order.

2017-10-19 Thread Hsnamed
Hello, i trying to build actor system as N-levels tree with mutable state/data . public class RootActor extends AbstractActor implements Loggable { String name; Root data; public static Props props(String name, Root data, List children) { return Props.create(RootActor.class, () ->

Re: [akka-user] Need of `onRecoveryCompleted` in akka typed for persistence

2017-10-19 Thread Yaroslav Klymko
I also have other concern regarding. case PersistAll(events) ⇒ // apply the event before persist so that validation exception is handled before persisting // the invalid event, in case such validation is implemented in the event handler. state = events.foldLeft(state)(applyEvent)