[akka-user] Re: Akka Actors and Integrating with Play Framework

2014-05-09 Thread 何品
Hi ,I have done this with right an Play plugin and api implement the api in the plugin, the implement just forward the request to the inner actor of the plugin. 在 2014年5月8日星期四UTC+8下午5时59分01秒,faisal...@gmail.com写道: > > Hello all, > > I am working on a fairly complicated system, and using Akka to o

Re: [akka-user] new hash based router

2014-05-09 Thread 何品
yes now I just using the context.child(name),cause I found that actorCell is using TreeMap,so if I want to achieve O(1),should I put an hashMap In my Actor implement?I found just as what you said,the RouterLogic is not the right approach for me. thanks for the answer 在 2014年5月9日星期五UTC+8上午2时59分

Re: [akka-user] Try-and-lock an FSM actor in a cluster, anything better?

2014-05-09 Thread Eugene Dzhurinsky
On Fri, May 09, 2014 at 05:18:09PM -0700, Ryan Tanner wrote: > I think you misunderstood what cluster events are for. > > MemberUp/Down aren't fired when your actors come up, they're fired when a > new member joins the cluster. If you want an actor to know when another > actor is ready, you nee

Re: [akka-user] Try-and-lock an FSM actor in a cluster, anything better?

2014-05-09 Thread Ryan Tanner
I think you misunderstood what cluster events are for. MemberUp/Down aren't fired when your actors come up, they're fired when a new member joins the cluster. If you want an actor to know when another actor is ready, you need to explicitly send a message. You can however use DeathWatch to kno

Re: [akka-user] Try-and-lock an FSM actor in a cluster, anything better?

2014-05-09 Thread Eugene Dzhurinsky
Roland, many thanks for the reply! As far as I understood, the proposed (and desired) way to partition a task across a cluster is to let the *worker* actors to *pull* a chunk of a task from a *task actor* instead of having the task actor to *push* the chunk of data to the *workers*. This sound

Re: [akka-user] Re: quorum-based split brain resolution

2014-05-09 Thread Lawrence Wagerfield
Yes, precisely what I was wondering, although probably not as well articulated! I am curious as, to my limited knowledge, RAFT prohibits split-brain. Does that mean RAFT therefore sits at the 'unavailable' end of the continuum you described, or does it somehow provide slightly greater availabil

Re: [akka-user] Re: quorum-based split brain resolution

2014-05-09 Thread Eric Pederson
Lawrence - were you wondering where the existing Akka-based Raft implementations (eg. ktoso/akka-raft ) sit in Roland's auto downing to no downing spectrum and/or if RAFT has any particular consistency requirements that map to one of Roland's categories? I'm curi

Re: [akka-user] Re: Responses from Cluster Singleton

2014-05-09 Thread Patrik Nordwall
> 9 maj 2014 kl. 18:54 skrev bhudgeons : > > Patrik, > > Thanks for the explanation. So, when you say: > >> On Thu, May 1, 2014 at 9:04 PM, bhudgeons wrote: >> Santoash, > >> > >> It is certainly possible, but it is confusing. I think what is probably >> happening is that you are passi

Re: [akka-user] Cluster sharding API

2014-05-09 Thread Patrik Nordwall
> 9 maj 2014 kl. 19:33 skrev Heiko Seeberger : > > Maybe we could have `start` return an `ActorRef` immediately, i.e. an > asynchronous operation like `actorOf`? I'm not sure it's worth the effort to implement something like RepointableActorRef for something that is called only at app start

[akka-user] Re: Pulling Pattern vs Durable Mailboxes

2014-05-09 Thread Ryan Tanner
Hi Luis, 1. First just to make sure I understood what you guys ended up doing, > whenever your supervisor crashes, an event is sent to some sort of event > bus to which workers your are subscribed to which let's them know that > their supervisor is down. When this happens, each worker that was

Re: [akka-user] Cluster sharding API

2014-05-09 Thread Heiko Seeberger
Maybe we could have `start` return an `ActorRef` immediately, i.e. an asynchronous operation like `actorOf`? Heiko On Fri, May 9, 2014 at 4:48 PM, Patrik Nordwall wrote: > > > > On Fri, May 9, 2014 at 4:43 PM, Jeroen Gordijn > wrote: > >> Thanks Patrik, I overlooked that it is blocking, that

Re: [akka-user] An example of cluster-client

2014-05-09 Thread Patrik Nordwall
> 9 maj 2014 kl. 18:46 skrev Eugene Dzhurinsky : > >> On Fri, May 09, 2014 at 04:03:26PM +0200, Patrik Nordwall wrote: >> In the log you posted I see that the problem is that "localhost" is not the >> same thing as "127.0.0.1". You must use the hostname you specfied in config >> akka.remote.nett

Re: [akka-user] Re: Responses from Cluster Singleton

2014-05-09 Thread bhudgeons
Patrik, Thanks for the explanation. So, when you say: On Thu, May 1, 2014 at 9:04 PM, bhudgeons wrote: > Santoash, > > It is certainly possible, but it is confusing. I think what is probably > happening is that you are passing an ActorRef in a message to the > ClusterSingleton. When you c

Re: [akka-user] An example of cluster-client

2014-05-09 Thread Eugene Dzhurinsky
On Fri, May 09, 2014 at 04:03:26PM +0200, Patrik Nordwall wrote: > In the log you posted I see that the problem is that "localhost" is not the > same thing as "127.0.0.1". You must use the hostname you specfied in config > akka.remote.netty.tcp.hostname Thanks, Patrik! -- Eugene N Dzhurinsky

[akka-user] akka extensions with arguments, any wise words ?

2014-05-09 Thread Olger Warnier
Hi All, I try to create an extension that needs a parameter in order todo it's job. extensions are created like: override def createExtension(system: ExtendedActorSystem) = { new MyExtension(system) } And I'd like have something like 'new MyExtension(system, myCustomParameter: AType)'

Re: [akka-user] Akka Persistence - Views with multiple processors

2014-05-09 Thread Olger Warnier
On Friday, May 9, 2014 5:58:42 PM UTC+2, Paweł Kaczor wrote: > On Friday, May 9, 2014 4:37:16 PM UTC+2, Olger Warnier wrote: > >> On Friday, May 9, 2014 4:29:32 PM UTC+2, Paweł Kaczor wrote: >> >>> On Sunday, April 20, 2014 4:59:22 PM UTC+2, Patrik Nordwall wrote: >>> The User actor

Re: [akka-user] Akka Persistence - Views with multiple processors

2014-05-09 Thread Paweł Kaczor
On Friday, May 9, 2014 4:37:16 PM UTC+2, Olger Warnier wrote: > > On Friday, May 9, 2014 4:29:32 PM UTC+2, Paweł Kaczor wrote: > >> On Sunday, April 20, 2014 4:59:22 PM UTC+2, Patrik Nordwall wrote: >> >>> >>> >>> The User actor persist FirstNameChanged, and inside the persist block it >>> sends

Re: [akka-user] Multiple client remoting senario

2014-05-09 Thread Roland Kuhn
Hi Liang, the ActorSystem creates the Actor, not the other way around. You might want to check some basic Activator tutorials to see some examples: https://typesafe.com/activator/template/hello-akka or check the lower left of http://akka.io/downloads/ Regards, Roland 9 maj 2014 kl. 16:48 skrev

Re: [akka-user] Multiple client remoting senario

2014-05-09 Thread Liang Tang
It helps tons!! Thanks you. Besides, Does akka implement the actorSystem pool? When an actor is being created, it is able to pick up a actorsystem from the pool. On Friday, May 9, 2014 12:18:48 AM UTC-5, rkuhn wrote: > > Hi Liang, > > 8 maj 2014 kl. 18:08 skrev Liang Tang >: > > Guys, > > Firs

Re: [akka-user] Cluster sharding API

2014-05-09 Thread Patrik Nordwall
On Fri, May 9, 2014 at 4:43 PM, Jeroen Gordijn wrote: > Thanks Patrik, I overlooked that it is blocking, that makes the fix even > easier. You mention that you would not do it in the same place and I don't > have enough experience to comment on that, but in the course it seemed > perfectly valid

Re: [akka-user] Cluster sharding API

2014-05-09 Thread Jeroen Gordijn
Thanks Patrik, I overlooked that it is blocking, that makes the fix even easier. You mention that you would not do it in the same place and I don't have enough experience to comment on that, but in the course it seemed perfectly valid to do just that. I created a ticket: https://github.com/akk

Re: [akka-user] Akka Persistence - Views with multiple processors

2014-05-09 Thread Olger Warnier
On Friday, May 9, 2014 4:29:32 PM UTC+2, Paweł Kaczor wrote: > On Sunday, April 20, 2014 4:59:22 PM UTC+2, Patrik Nordwall wrote: > >> >> >> The User actor persist FirstNameChanged, and inside the persist block it >> sends a Persistent(FirstNameChanged) message to the AllUsers Processor. On >> t

Re: [akka-user] Akka Persistence - Views with multiple processors

2014-05-09 Thread Paweł Kaczor
On Sunday, April 20, 2014 4:59:22 PM UTC+2, Patrik Nordwall wrote: > > > > The User actor persist FirstNameChanged, and inside the persist block it > sends a Persistent(FirstNameChanged) message to the AllUsers Processor. On > the query side we have a AllUsersView connected to that processor. W

Re: [akka-user] Cluster sharding API

2014-05-09 Thread Patrik Nordwall
You should be able to do those calls immediately after each other, from same thread. ClusterSharding(context.system).start ClusterSharding(context.system).shardRegion Start doesn't return until it has been initalized. Normally, I don't think these two things are done at the same place in the code

[akka-user] Cluster sharding API

2014-05-09 Thread Jeroen Gordijn
Hi, I followed the Advanced akka course in the last 2 days (which was awesome by the way) and noticed something of the API which I think can be improved. When you start the ClusterSharding its return type is Unit and you have to retrieve the ShardRegion by calling the "shardRegion" on ClusterSh

Re: [akka-user] Akka cluster failover: hot swaping

2014-05-09 Thread Eduardo Fernandes
Hello Roland. Many thanks for your answer. Very clear point of view. Many thanks for your help! Regards, Eduardo. El jueves, 8 de mayo de 2014 10:24:11 UTC+2, Akka Team escribió: > > Hi Eduardo, > > there are several parts which will have to play together in relation to > your requirement

Re: [akka-user] An example of cluster-client

2014-05-09 Thread Patrik Nordwall
Take a look at: http://typesafe.com/activator/template/akka-distributed-workers In the log you posted I see that the problem is that "localhost" is not the same thing as "127.0.0.1". You must use the hostname you specfied in config akka.remote.netty.tcp.hostname /Patrik On Fri, May 9, 2014 at 3

[akka-user] An example of cluster-client

2014-05-09 Thread Eugene Dzhurinsky
Hello! I'm wondering if there's an example of cluster ciient usage available in sources? I've read the doc at http://doc.akka.io/docs/akka/2.2.3/contrib/cluster-client.html and it's not clear how to use that in case if the cient is started in a separate JVM outside of a cluster. For example,

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Roland Kuhn
9 maj 2014 kl. 14:57 skrev Chanan Braunstein : > Since you asked for feedback: > > We are using EventsourcedProcessor and have no plans to use Processor. We saw > the benchmarks and read the docs that Processor is faster, but choose to > model our system using traditional DDD. We understood th

Re: [akka-user] Testing that an actor throws an exception

2014-05-09 Thread Roland Kuhn
Hi Carsten, 9 maj 2014 kl. 14:50 skrev Carsten Saathoff : > Hi, > > Am Freitag, 9. Mai 2014 13:34:50 UTC+2 schrieb Konrad Malawski: > How about extracting the actor’s behaviour to a trait, and test that trait > for the expected throw behaviour using plain old ScalaTest > `intercept[Exception]

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Chanan Braunstein
Since you asked for feedback: We are using EventsourcedProcessor and have no plans to use Processor. We saw the benchmarks and read the docs that Processor is faster, but choose to model our system using traditional DDD. We understood the trade-off we were making. The proposal to add something

Re: [akka-user] Testing that an actor throws an exception

2014-05-09 Thread Carsten Saathoff
Hi, Am Freitag, 9. Mai 2014 13:34:50 UTC+2 schrieb Konrad Malawski: > > How about extracting the actor’s behaviour to a trait, and test that trait > for the expected throw behaviour using plain old ScalaTest > `intercept[Exception] { … }`, would it make sense in your case or are the > interacti

Re: [akka-user] Reactive applications with CQRS and Akka Persistence?

2014-05-09 Thread Jonas Bonér
On Thu, May 8, 2014 at 10:28 PM, Akka Team wrote: > Hi Ashley, > > it is good that you ask these questions! [answers inline] > > On Tue, May 6, 2014 at 8:28 AM, Ashley Aitken wrote: > >> >> >> I thought reactive applications were all event-based and, in particular, >> events could be generated a

Re: [akka-user] Re: quorum-based split brain resolution

2014-05-09 Thread Jonas Bonér
On Thu, May 8, 2014 at 5:35 PM, Lawrence Wagerfield < lawre...@dmz.wagerfield.com> wrote: > Fascinating and very helpful! > > Out of interest, where does RAFT sit on the aforementioned spectrum? I > only ask as there's a few Akka RAFT implementations floating around... > ​We have not talked about

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Jonas Bonér
I think this is an excellent proposal. I've been out there talking to lots of users that are using (or want to use) Akka Persistence and most of them are struggling with the current complexity of the Processor/Channel/Persistent combo and when to use it and when to rely on EventsourcedProcessor in

[akka-user] [Java 2.3.2] Cannot create actor with mailbox

2014-05-09 Thread Chanan Braunstein
Hello, I am sure I am missing something obvious, but I don't see it. I created a simple priority mailbox similar to the one in the doc: package services; ... public class PriorityMailbox extends UnboundedPriorityMailbox { public PriorityMailbox(ActorSystem.Settings settings, Config config)

Re: [akka-user] Testing that an actor throws an exception

2014-05-09 Thread Konrad 'ktoso' Malawski
How about extracting the actor’s behaviour to a trait, and test that trait for the expected throw behaviour using plain old ScalaTest `intercept[Exception] { … }`, would it make sense in your case or are the interactions “very relying on the thing being an actor”? Having that said, it’s just my

Re: [akka-user] Testing that an actor throws an exception

2014-05-09 Thread Carsten Saathoff
I don't think it's a matter of my use-case, I think it's a matter of test case granularity. In my system, I throw the Exception because I want the parent to act upon it, so it's part of the actors API. However, I tend to test actors in isolation, i.e., I want to test the child alone and make s

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Patrik Nordwall
Hi all, Interesting discussion. I have no problem removing command sourced Processor from user API, with the added capabilities of EventsourcedProcessor. I have thought of P as a low level building block and only to be used for simple write-ahead-log scenarios. External side-effects during replay

Re: [akka-user] Testing that an actor throws an exception

2014-05-09 Thread Konrad Malawski
Nothing like that in TestKit, reason being - you don't usually interact with Actors like that. I think the test should feel more like "when this happens, will it be restarted by it's parent"? etc. I'd rather structure the test like that, but maybe there's something I'm missing in your use-case. O

[akka-user] Testing that an actor throws an exception

2014-05-09 Thread Carsten Saathoff
Hi, I am currently trying to figure out how to best test whether an actor throws an exception. The only solution I can think of is creating that actor as a child of another actor and use the standard supervision to somehow propagate the exception to the test code (probably there are several wa

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread ahjohannessen
Hi Roland, We use Channel in conjunction with Eventsourced Processor (EP) in our applications in receiveRecover. It would be sad to see it go away without a reasonable alternative. One scenario in our apps is that we use DDD/ES and have a lot of EPs of same type, e.g. 1 instances, that a

Re: [akka-user] Re: Responses from Cluster Singleton

2014-05-09 Thread Patrik Nordwall
If I understand it you question it is about: scala> RemoteSystem.remoteActor ! Start(RemoteSystem.clusterActor) and why the singleton actor receives sender path with "wrong" system name. You are doing something that is not supported. You grab an ActorRef belonging to one ActorSystem and use that

Re: [akka-user] Re: Future time out

2014-05-09 Thread Roland Kuhn
9 maj 2014 kl. 10:31 skrev Muki : > @Giovanni it could be the idle status in my case, too. My app is rarely used > and I have an actor per shard, which makes them even less used. > > @Roland This is an interesting point. My setup is very basic. No cluster, no > extra config, not even high-loa

Re: [akka-user] Re: Future time out

2014-05-09 Thread Muki
@Giovanni it could be the idle status in my case, too. My app is rarely used and I have an actor per shard, which makes them even less used. @Roland This is an interesting point. My setup is very basic. No cluster, no extra config, not even high-load and still there's a chance of loosing reply

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Roland Kuhn
9 maj 2014 kl. 09:58 skrev Martin Krasser : > > On 09.05.14 09:25, Roland Kuhn wrote: >> >> 9 maj 2014 kl. 09:08 skrev Martin Krasser : >> >>> >>> On 09.05.14 08:41, Roland Kuhn wrote: Hi Martin, 9 maj 2014 kl. 08:05 skrev Martin Krasser : > Hi Roland, > > t

Re: [akka-user] How can the sender know that a message has been delivered (confirmed) by a channel?

2014-05-09 Thread Martin Krasser
On 09.05.14 09:25, Roland Kuhn wrote: 9 maj 2014 kl. 09:08 skrev Martin Krasser >: On 09.05.14 08:41, Roland Kuhn wrote: Hi Martin, 9 maj 2014 kl. 08:05 skrev Martin Krasser >: Hi Roland, thanks for starting a discussion

Re: [akka-user] Unexpected result on resolveOne (send ActorIdentify) (Akka 2.3.2)

2014-05-09 Thread Wofr
Thanks! Good do know! Frankly speaking I was a little bit confused by the results :) Regards Wolfgang Am Donnerstag, 8. Mai 2014 14:39:41 UTC+2 schrieb Akka Team: > > Hi Wolfgang, > > that is obviously a bug , > thanks for noticing! For reference, it