Re: [akka-user] Akka Consistent Hashing Router
What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M sendhi...@gmail.comwrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another actor with another CHR. The messages are going to different routees for the same hash key. Can someone please explain how the consistent hashing router is implemented? What are the factors it uses to build the hashing and how it routes? -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] java.io.NotSerializableException with customer serialization object
Yes. Can you please tell me how to do that for messages in ReliableProxy? I would like to make contribution. Thanks for help. On Tuesday, 18 March 2014 17:17:26 UTC+8, Patrik Nordwall wrote: Hi, That is because the original message is wrapped in a ReliableProxy.Message, which only has java serialization. It would be a great contribution to provide a serializer for ReliableProxy.Message that use the configured serializer for the wrapped message. If you are up for the job I can guide you how to do it. Cheers, Patrik On Tue, Mar 18, 2014 at 10:03 AM, lee json jsonl...@gmail.comjavascript: wrote: My custom serialization object with remoting works without a problem. The NotSerializableException is thrown when adding ReliableProxy. val proxy = context.system.actorOf(Props(classOf[ReliableProxy], remoteR ef, 100.millis), proxy) // remoteRef ! customSerializedObject // - this works fine, remote can receive the message correctly. proxy ! customSerializedObject // - this throws NotSerializableException. From the stack trace, it looks like inside the FSM, it can't select the correct serializer ( it always selects JavaSerializer ) in ReliableProxy class. Is there any work around or what might be the root cause for this issue? akka version is 2.2.3 java version is 1.6.x scala is 2.10.x Thanks Transient association error (association remains live) java.io.NotSerializableException: sample.model.CustomSerializedObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.serialization.JavaSerializer.toBinary(Serializer.scala:129) at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.remote.EndpointWriter.akka$remote$EndpointWriter$$serializeMessage(Endpoint.scala:671) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:559) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:544) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) at akka.actor.FSM$class.processEvent(FSM.scala:595) at akka.remote.EndpointWriter.processEvent(Endpoint.scala:443) at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:589) at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:583) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) at akka.actor.ActorCell.invoke(ActorCell.scala:456) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) at akka.dispatch.Mailbox.run(Mailbox.scala:219) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) -- 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 javascript:. To post to this group, send email to akka...@googlegroups.comjavascript: . Visit this group at http://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
Re: [akka-user] java.io.NotSerializableException with customer serialization object
It seems my message was deleted. So sorry post again. Can you please give me advice on how to serialize message in ReliableProxy? I would like to make contribution. Apology if sending redundant messages. Thanks On Tuesday, 18 March 2014 17:17:26 UTC+8, Patrik Nordwall wrote: Hi, That is because the original message is wrapped in a ReliableProxy.Message, which only has java serialization. It would be a great contribution to provide a serializer for ReliableProxy.Message that use the configured serializer for the wrapped message. If you are up for the job I can guide you how to do it. Cheers, Patrik On Tue, Mar 18, 2014 at 10:03 AM, lee json jsonl...@gmail.comjavascript: wrote: My custom serialization object with remoting works without a problem. The NotSerializableException is thrown when adding ReliableProxy. val proxy = context.system.actorOf(Props(classOf[ReliableProxy], remoteR ef, 100.millis), proxy) // remoteRef ! customSerializedObject // - this works fine, remote can receive the message correctly. proxy ! customSerializedObject // - this throws NotSerializableException. From the stack trace, it looks like inside the FSM, it can't select the correct serializer ( it always selects JavaSerializer ) in ReliableProxy class. Is there any work around or what might be the root cause for this issue? akka version is 2.2.3 java version is 1.6.x scala is 2.10.x Thanks Transient association error (association remains live) java.io.NotSerializableException: sample.model.CustomSerializedObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.serialization.JavaSerializer.toBinary(Serializer.scala:129) at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.remote.EndpointWriter.akka$remote$EndpointWriter$$serializeMessage(Endpoint.scala:671) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:559) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:544) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) at akka.actor.FSM$class.processEvent(FSM.scala:595) at akka.remote.EndpointWriter.processEvent(Endpoint.scala:443) at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:589) at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:583) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) at akka.actor.ActorCell.invoke(ActorCell.scala:456) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) at akka.dispatch.Mailbox.run(Mailbox.scala:219) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) -- 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 javascript:. To post to this group, send email to akka...@googlegroups.comjavascript: . Visit this group at http://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
Re: [akka-user] java.io.NotSerializableException with customer serialization object
20 mar 2014 kl. 08:53 skrev lee json jsonlee...@gmail.com: It seems my message was deleted. So sorry post again. We don’t delete messages, but this list is moderated to keep the spam out; I added a welcome message explaining this yesterday. Regards, Roland Can you please give me advice on how to serialize message in ReliableProxy? I would like to make contribution. Apology if sending redundant messages. Thanks On Tuesday, 18 March 2014 17:17:26 UTC+8, Patrik Nordwall wrote: Hi, That is because the original message is wrapped in a ReliableProxy.Message, which only has java serialization. It would be a great contribution to provide a serializer for ReliableProxy.Message that use the configured serializer for the wrapped message. If you are up for the job I can guide you how to do it. Cheers, Patrik On Tue, Mar 18, 2014 at 10:03 AM, lee json jsonl...@gmail.com wrote: My custom serialization object with remoting works without a problem. The NotSerializableException is thrown when adding ReliableProxy. val proxy = context.system.actorOf(Props(classOf[ReliableProxy], remoteRef, 100.millis), proxy) // remoteRef ! customSerializedObject // - this works fine, remote can receive the message correctly. proxy ! customSerializedObject // - this throws NotSerializableException. From the stack trace, it looks like inside the FSM, it can't select the correct serializer ( it always selects JavaSerializer ) in ReliableProxy class. Is there any work around or what might be the root cause for this issue? akka version is 2.2.3 java version is 1.6.x scala is 2.10.x Thanks Transient association error (association remains live) java.io.NotSerializableException: sample.model.CustomSerializedObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:129) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.serialization.JavaSerializer.toBinary(Serializer.scala:129) at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$serializeMessage$1.apply(Endpoint.scala:672) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.remote.EndpointWriter.akka$remote$EndpointWriter$$serializeMessage(Endpoint.scala:671) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:559) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:544) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) at akka.actor.FSM$class.processEvent(FSM.scala:595) at akka.remote.EndpointWriter.processEvent(Endpoint.scala:443) at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:589) at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:583) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) at akka.actor.ActorCell.invoke(ActorCell.scala:456) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) at akka.dispatch.Mailbox.run(Mailbox.scala:219) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) -- 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 http://groups.google.com/group/akka-user. For
Re: [akka-user] Replay Intro to Akka persistence with Patrik Nordwall
The recording is here: https://www.youtube.com/watch?v=r5lecCBazvE and the slides: http://www.slideshare.net/patriknw/akka-persistence-webinar /Patrik On Thu, Mar 20, 2014 at 12:41 AM, James james.le...@gmail.com wrote: I missed the live, is this going to be available on Yotube? -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Multi-jvm test property settings when using sbt test
Hi Allan, Take a look at this Typesafe Activator template: https://typesafe.com/activator/template/akka-sample-multi-node-scala Let us know if that solves your problem or not. /Patrik On Wed, Mar 19, 2014 at 10:55 PM, Allan Brighton allane...@gmail.comwrote: Correction: The *multinode.max-nodes *property does not need to be set if sbt multi-jvm:test is run, but if I run sbt test, I get: java.lang.IllegalStateException: need system property multinode.max-nodes to be set On Wednesday, March 19, 2014 10:29:13 PM UTC+1, Allan Brighton wrote: Hi, I'm using the settings below for a multi-jvm test. After upgrading to Akka-2.3.0, I got an error stating that I needed to define the *multinode.max-nodes * system property. I added that below and now it works when I run sbt multi-jvm:test, but I can't figure out how to add the setting so that it is used with sbt test as well. Any tips? lazy val multiJvmSettings = SbtMultiJvm.multiJvmSettings ++ Seq( // make sure that MultiJvm test are compiled by the default test compilation compile in MultiJvm = (compile in MultiJvm) triggeredBy (compile in Test), // Required system property jvmOptions in MultiJvm += -Dmultinode.max-nodes=2, // Next line fixes missing source folder in idea project unmanagedSourceDirectories in Test += baseDirectory { _ / src / multi-jvm / scala }, parallelExecution in Global := false, executeTests in Test = (executeTests in Test, executeTests in MultiJvm) map { case ((testResults), (multiJvmResults)) = val overall = if (testResults.overall.id multiJvmResults.overall.id) multiJvmResults.overall else testResults.overall Tests.Output(overall, testResults.events ++ multiJvmResults.events, testResults.summaries ++ multiJvmResults.summaries) } ) Thanks, Allan -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] java.io.NotSerializableException with customer serialization object
On Thu, Mar 20, 2014 at 8:46 AM, lee json jsonlee...@gmail.com wrote: Yes. Can you please tell me how to do that for messages in ReliableProxy? I would like to make contribution. Great. 1. Create a protobuf representation of ReliableProxy.Message, see Send in akka-contrib/src/main/protobuf/DistributedPubSubMessages.proto 2. Create a seraializer, see sendToProto and sendFromBinary in akka-contrib/src/main/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializer.scala Serialize actor ref as described here: http://doc.akka.io/docs/akka/2.3.0/scala/serialization.html#Serializing_ActorRefs 3. Add serializer to akka-contrib/src/main/resources/reference.conf Bonus points if you also make protobuf for ReliableProxy.Ack. Thank you for contributing. /Patrik Thanks for help. On Tuesday, 18 March 2014 17:17:26 UTC+8, Patrik Nordwall wrote: Hi, That is because the original message is wrapped in a ReliableProxy.Message, which only has java serialization. It would be a great contribution to provide a serializer for ReliableProxy.Message that use the configured serializer for the wrapped message. If you are up for the job I can guide you how to do it. Cheers, Patrik On Tue, Mar 18, 2014 at 10:03 AM, lee json jsonl...@gmail.com wrote: My custom serialization object with remoting works without a problem. The NotSerializableException is thrown when adding ReliableProxy. val proxy = context.system.actorOf(Props(classOf[ReliableProxy], remoteR ef, 100.millis), proxy) // remoteRef ! customSerializedObject // - this works fine, remote can receive the message correctly. proxy ! customSerializedObject // - this throws NotSerializableException. From the stack trace, it looks like inside the FSM, it can't select the correct serializer ( it always selects JavaSerializer ) in ReliableProxy class. Is there any work around or what might be the root cause for this issue? akka version is 2.2.3 java version is 1.6.x scala is 2.10.x Thanks Transient association error (association remains live) java.io.NotSerializableException: sample.model.CustomSerializedObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields( ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData( ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject( ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0( ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp( Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$ toBinary$1.apply(Serializer.scala:129) at akka.serialization.JavaSerializer$$anonfun$ toBinary$1.apply(Serializer.scala:129) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.serialization.JavaSerializer.toBinary(Serializer.scala:129) at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$ serializeMessage$1.apply(Endpoint.scala:672) at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$ serializeMessage$1.apply(Endpoint.scala:672) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57) at akka.remote.EndpointWriter.akka$remote$EndpointWriter$$ serializeMessage(Endpoint.scala:671) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse( Endpoint.scala:559) at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(Endpoint.scala:544) at scala.runtime.AbstractPartialFunction.apply( AbstractPartialFunction.scala:33) at akka.actor.FSM$class.processEvent(FSM.scala:595) at akka.remote.EndpointWriter.processEvent(Endpoint.scala:443) at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:589) at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:583) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) at akka.actor.ActorCell.invoke(ActorCell.scala:456) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) at akka.dispatch.Mailbox.run(Mailbox.scala:219) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec( AbstractDispatcher.scala:386) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue. runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker( ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run( ForkJoinWorkerThread.java:107) -- 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
[akka-user] Some system returns unexpected from quarantine
Hi ! We use Akka 2.3.0. with the default configuration for akka remote We have 2 system on 2 nodes running which are remote connected and watch each other. When we put e.g. one Node-A under heavy heavy load the system gets quarantined by Node-B with the following log. *09:46:51.475 WARN Association to [akka.tcp://Test-AllInOne-Local@10.95.28.149:2552] having UID [-1869651349] is irrecoverably failed. UID is now quarantined and all messages to this UID will be delivered to dead letters. Remote actorsystem must be restarted to recover from this situation.* When we now put the load form Node-A after a certain time it continuous to communicate with Node-B and Node-B is talking to Node-A...so the quarantine seems not to work in this case because non of our system is restarted. Maybe this is caused because as soon as the watch is telling us that Node-A is Terminated we start to try resolve a certain actor of Node-A again. Funny fact is that an external system which is also watching an actor on our Node-A is not able to communicate with Node-A after it puts in quarantine. But this external system does no resolve the simple do an actorSelection. Any help welcome! Wolfgang -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] Re: PersistentChannel wired behavior
I think I may have found a bug: Please find my code in this gist https://gist.github.com/dong77/9659988 If you delete line75, the replay will work, otherwise, each replay will genera new events. Here is the failure senario: There are two processors A and B. A handles persistent messages of type X and Y, when handling X, A actually does nothing; but when handling Y, A will yield a message Z through a persistent channel to processor B. B only handles Z and simply confirms all messages received. To make the replay fail, simply send A a persistent X event, then send A a persistent Y event. Theoretically, after A and B processed all messages, journal shall have 4 events: X, Y, Z and a channel confirmation for Z; but what I saw are 5 events including the channel message that should be deleted upon confirmation. I used mongodb as journal store, here are these events (also in the gist): -IF i didn't send A an X: db.messages.find() { _id : ObjectId(532ab02be31876dceb18ec85), processorId : test_first, sequenceNr : NumberLong(1), marker : A, message : BinData(0,Cg0IARIJrO0ABXQAAmhpEAEaCnRlc3RfZmlyc3QgADAAQABaGWFra2E6Ly9jb2luZXgvZGVhZExldHRlcnM=) } { _id : ObjectId(532ab02be31876dceb18ec87), processorId : test_first, sequenceNr : NumberLong(1), marker : C-/user/first/singleton/first_channel, message : BinData(0,) } { _id : ObjectId(532ab02be31876dceb18ec88), processorId : test_second, sequenceNr : NumberLong(1), marker : A, message : BinData(0,Cg0IARIJrO0ABXQAAkhJEAEaC3Rlc3Rfc2Vjb25kIAAwAEABWkVha2thLnRjcDovL2NvaW5leEAxOTIuMTY4LjAuMTAzOjI1NTUyL3VzZXIvZmlyc3Qvc2luZ2xldG9uIzE3NjU3NDY3NTA=) } -IF i did send A an X: db.messages.find() { _id : ObjectId(532ab0d3e3182e6b37f5d05e), processorId : test_first, sequenceNr : NumberLong(1), marker : A, message : BinData(0,ClUIARJRrO0ABXNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAMEAEaCnRlc3RfZmlyc3QgADAAQABaGWFra2E6Ly9jb2luZXgvZGVhZExldHRlcnM=) } { _id : ObjectId(532ab0d3e3182e6b37f5d05f), processorId : test_first, sequenceNr : NumberLong(2), marker : A, message : BinData(0,Cg0IARIJrO0ABXQAAmhpEAIaCnRlc3RfZmlyc3QgADAAQABaGWFra2E6Ly9jb2luZXgvZGVhZExldHRlcnM=) } { _id : ObjectId(532ab0d3e3182e6b37f5d060), processorId : /user/first/singleton/first_channel, sequenceNr : NumberLong(1), marker : A, message : BinData(0,CoABCAcSYgo+Cg0IARIJrO0ABXQAAkhJEAIaCnRlc3RfZmlyc3QgADAAQABaGWFra2E6Ly9jb2luZXgvZGVhZExldHRlcnMSIGFra2E6Ly9jb2luZXgvdXNlci9zZWNvbmRfcm91dGVyGhhha2thLnBlcnNpc3RlbmNlLkRlbGl2ZXIQARojL3VzZXIvZmlyc3Qvc2luZ2xldG9uL2ZpcnN0X2NoYW5uZWwgADAAQABaRmFra2EudGNwOi8vY29pbmV4QDE5Mi4xNjguMC4xMDM6MjU1NTIvdXNlci9maXJzdC9zaW5nbGV0b24jLTIwMjAzNTcwODM=) } { _id : ObjectId(532ab0d3e3182e6b37f5d061), processorId : test_first, sequenceNr : NumberLong(2), marker : C-/user/first/singleton/first_channel, message : BinData(0,) } { _id : ObjectId(532ab0d4e3182e6b37f5d062), processorId : test_second, sequenceNr : NumberLong(1), marker : A, message : BinData(0,Cg0IARIJrO0ABXQAAkhJEAEaC3Rlc3Rfc2Vjb25kIAAwAEABWkZha2thLnRjcDovL2NvaW5leEAxOTIuMTY4LjAuMTAzOjI1NTUyL3VzZXIvZmlyc3Qvc2luZ2xldG9uIy0yMDIwMzU3MDgz) } -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Please have a look at my generated Reactive web-based app
Hi Robin, Thanks for sharing. The Akka core team doesn't have the bandwidth to review this. Regards, Patrik On Tue, Mar 18, 2014 at 9:21 AM, Robin Bakkerus robin.bakke...@gmail.comwrote: Hi After participating in the Scala reactive course at Coursera last year, I jumped on the Scala, Slick, Spray and Akka bandwagons. The results so far are promising, and a delight compared with the Java, Hibernate stack I worked on for (too) many years. In fact so promising that I created a completely new cartridge based on my *EasyMda* to generate a reactive backed, based on the tools mentioned above. At this point I am able to generate a fully functional working application, in just a few second, after the model is defined! There are still many things that need improved in this 'reactive' cartridge, but I believe it is now ready enough to demonstrate. Hence my question to you, if you want to have a look at this generated reactive demo app, and tell me what is good, and more important tell me what can be improved, so that I can update the cartridge accordingly. I have attached the following: - A zipfile with the generated app generated-reactive. This is a regular Scala project that can be opened in a Scala Ide (3.0.2). It contains a DemoMain file that starts the webserver on port 8000. The datasource(s) can be controlled in application.conf. It also contains a number of junit tests to test the dao layer (see pck: *flca.demo.data.test.dao*) All the files under *src /main/scala* resp *src/test/scala*. Under src-easy-model, the Java files can be found that were used to generate the application. You may find more info on *EasyMda* at: *https://code.google.com/p/easymda/ https://code.google.com/p/easymda/ * here you can also find links to YouTube videos how to use *EasyMda (*for example: http://www.youtube. com/watch?v=s1bCPQGYjOY ) I hope you can give me feedback, because a good code generator may not only give you the ability quickly generate a lot of plumbing code, but (imo) more important, may generate high quality code. So that you can concentrate on the actual implementation. About the current reactive cartridge: I wanted to generate an application that is completely stateless and asynchronously, without all Hibernate headaches and very fast! This lead me to Spray to handle the http/json requests. Akka as the asynchronous middle-ware and Slick for persistence. Most of the time was spent in the ability to support complete ORM mapping, similar to Hibernate but than better. See the README uncer *flca.demo.entity.dao* Foreseen improvements - see the TODO's in the Eclipse task window - @ManyToMany resulting in a join is not yet supported. - Optimistic locking using a Version should be supported - The *findXxx *should support an optional filter and also paging facility - Before a *saveXxx *is executed, the object should be validated first, that returns all the problems to the client if validation fails. - All the retrieve queries should run in parallel - Security should be supported, not only globally but also fine grained and role-base per service call. - Cors headers should be supported - Actors should be monitored - And many more minor improvements ... Next steps In the coming weeks I want update the hosting site with the new cartride and prepare a new plugin, including this cartridge. I also want to migrate the Dojo cartridge and I am thinking of creating new frontend cartridges Play? .. Dart? But most important is to in-cooperate your comments in order to generate a state-of-art next generation web-based application based on the principles of the Reactive Manifesto. I am looking to you comments. -- 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 http://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
Re: [akka-user] Cluster/remote pipeline strategy
El jueves, 20 de marzo de 2014 09:44:28 UTC+1, Patrik Nordwall escribió: Hi Eduardo, Many thanks for your time, Patrik. On Thu, Mar 20, 2014 at 12:04 AM, Eduardo Fernandes edu...@gmail.comjavascript: wrote: Hi all. We have a system where we've implemented a pipeline strategy as follows: The idea is move our current architecture to Akka. Taking into consideration that the Akka cluster technology abstracts almost everything related to where the actors are and how many pending messages exist to a particular physical host, etc. That is not true. Akka cluster is essentially cluster membership, including failure detection. Several tools, such as cluster aware routers, are provided on top of this, but you have full control of where and how to run the actors when you need that. Gotcha. What I couldn't find is, for example, flush all mailboxes to actors in a particular host. The idea is to optimize the packets on the wire with a single shot with as many as pending commands as possible to a particular physical node. In fact I don't know exactly how to flush pending commands to the wire. I'm sure it is because I don't heavy enough knowledge about Akka yet. my question is: Is the internal Akka net pipeline more or less equivalent to our one or, in case of not, could I plug in something similar our current pipeline into Akka? We've found that the three criteria aforementioned enabled us to adjust our current technology to a wide range of customer requirements. To give me a more clear picture, can you give some example of what this solves. We're calling Akka actors from a farm of tomcat's (hundreds) where each tomcat manages 5.000 - 9.000 concurrent users. To achieve this we have a competition criteria to flush the pending net packages (we, currently, manage byte arrays) which accumulates many pending user commands. As we need, in many cases, the response of the async cal, we need to block the thread waiting for the response. So the criteria to flush the packets to the wire is a combination of : total number of threads blocked, total volume of data pending to be sent and a max timeout. From our experience, if we have many many small packets (100 bytes) it is better to accumulate (typically up to 2-3 Kb) and then flush. If there are aprox 40 threads blocked we also flush to increase tomcat throughput. So, depending of the application scenario on or other criteria will apply with more or less relevance. Until now a good choice of the 'magic numbers' solves the problem with very good results. I'm wondering if this criteria applies to Akka or not. Maybe Akka solves this kind of problem automatically auto-adapting itself to the better combination. I couldn't find the right way to go on after reading the docs Dispatchers, Routers, and mailboxes, (and also I'm a novice Akka user). I'm not sure I understand what you are trying to do and why, but one solution might be to pass the messages via an actor that is responsible for the buffering and flushing. Maybe it is what we need. Is out there some example of this kind of actor doing both things (buffering and flushing to the wire) the pending packets? It sounds that is exactly what we want. Thanks Patrik again for your time and for dedicating calories to understand so many different scenarios. Best regards, Regards, Patrik Many thanks for your help and suggestions. Best regards, Eduardo. -- 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 javascript:. To post to this group, send email to akka...@googlegroups.comjavascript: . Visit this group at http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Multi-jvm test property settings when using sbt test
Hi Patrik, It turns out that this line was the problem: unmanagedSourceDirectories in Test += baseDirectory { _ / src / multi-jvm / scala }, I added it to fix a problem in the generated Idea-13.1 projects, which are always missing the multi-jvm source directory in the settings. For some reason that causes a problem when running the test target. Any suggestions for a fix? Thanks, Allan On Thursday, March 20, 2014 9:30:08 AM UTC+1, Patrik Nordwall wrote: Hi Allan, Take a look at this Typesafe Activator template: https://typesafe.com/activator/template/akka-sample-multi-node-scala Let us know if that solves your problem or not. /Patrik On Wed, Mar 19, 2014 at 10:55 PM, Allan Brighton alla...@gmail.comjavascript: wrote: Correction: The *multinode.max-nodes *property does not need to be set if sbt multi-jvm:test is run, but if I run sbt test, I get: java.lang.IllegalStateException: need system property multinode.max-nodes to be set On Wednesday, March 19, 2014 10:29:13 PM UTC+1, Allan Brighton wrote: Hi, I'm using the settings below for a multi-jvm test. After upgrading to Akka-2.3.0, I got an error stating that I needed to define the *multinode.max-nodes *system property. I added that below and now it works when I run sbt multi-jvm:test, but I can't figure out how to add the setting so that it is used with sbt test as well. Any tips? lazy val multiJvmSettings = SbtMultiJvm.multiJvmSettings ++ Seq( // make sure that MultiJvm test are compiled by the default test compilation compile in MultiJvm = (compile in MultiJvm) triggeredBy (compile in Test), // Required system property jvmOptions in MultiJvm += -Dmultinode.max-nodes=2, // Next line fixes missing source folder in idea project unmanagedSourceDirectories in Test += baseDirectory { _ / src / multi-jvm / scala }, parallelExecution in Global := false, executeTests in Test = (executeTests in Test, executeTests in MultiJvm) map { case ((testResults), (multiJvmResults)) = val overall = if (testResults.overall.id multiJvmResults.overall.id) multiJvmResults.overall else testResults.overall Tests.Output(overall, testResults.events ++ multiJvmResults.events, testResults.summaries ++ multiJvmResults.summaries) } ) Thanks, Allan -- 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 javascript:. To post to this group, send email to akka...@googlegroups.comjavascript: . Visit this group at http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] How to test that an actor sends a message to another actor
I am using Scala 2.9.2 and Akka 2.0.x. I have two actors: class DoWorkActor extends Actor { val manager = context.system.ActorSelection(user/manager) def receive = { case go = { // do some work manager ! success } } } class ManagerActor extends Actor { var successCount = 0 def receive = { case success = { successCount += 1 } case getSuccessCount = { sender ! successCount } } } I want to verify that the DoWorkActor sends a success to the ManagerActor. I'm trying with the following test: class DoWorkActorSpec extends FunSpec { val config = ConfigFactory.load() implicit val actorSystem = ActorSystem(test, config) implicit val timeout = Timeout(500) val managerRef = TestActorRef(new ManagerActor) actorSystem.actorOf(Props(managerRef.underlyingActor), name = manager) describe(#receive) { it(should send a success message to the manager) { val doWorkActor = TestActorRef(new DoWorkActor) doWorkActor ! go val count = Await.result((managerRef ? getSuccessCount), 5 seconds) assert(count === 1) } } Somtimes this test passes, but usually it fails. I put println statements in the Manger actor and I can see that it usually gets the getSuccessCount message before the success message. If I put in a Thread.sleep(100) after sending the go message to the DoWorkActor, the test passes. I thought by using TestActorRef's, things would be asynchronous but it seems like they're not. Am I doing something wrong? Any suggestions? Thanks. -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Cluster/remote pipeline strategy
On Thu, Mar 20, 2014 at 12:25 PM, Eduardo Fernandes edu...@gmail.comwrote: El jueves, 20 de marzo de 2014 09:44:28 UTC+1, Patrik Nordwall escribió: Hi Eduardo, Many thanks for your time, Patrik. On Thu, Mar 20, 2014 at 12:04 AM, Eduardo Fernandes edu...@gmail.comwrote: Hi all. We have a system where we've implemented a pipeline strategy as follows: The idea is move our current architecture to Akka. Taking into consideration that the Akka cluster technology abstracts almost everything related to where the actors are and how many pending messages exist to a particular physical host, etc. That is not true. Akka cluster is essentially cluster membership, including failure detection. Several tools, such as cluster aware routers, are provided on top of this, but you have full control of where and how to run the actors when you need that. Gotcha. What I couldn't find is, for example, flush all mailboxes to actors in a particular host. The idea is to optimize the packets on the wire with a single shot with as many as pending commands as possible to a particular physical node. In fact I don't know exactly how to flush pending commands to the wire. I'm sure it is because I don't heavy enough knowledge about Akka yet. my question is: Is the internal Akka net pipeline more or less equivalent to our one or, in case of not, could I plug in something similar our current pipeline into Akka? We've found that the three criteria aforementioned enabled us to adjust our current technology to a wide range of customer requirements. To give me a more clear picture, can you give some example of what this solves. We're calling Akka actors from a farm of tomcat's (hundreds) where each tomcat manages 5.000 - 9.000 concurrent users. To achieve this we have a competition criteria to flush the pending net packages (we, currently, manage byte arrays) which accumulates many pending user commands. As we need, in many cases, the response of the async cal, we need to block the thread waiting for the response. So the criteria to flush the packets to the wire is a combination of : total number of threads blocked, total volume of data pending to be sent and a max timeout. Sounds like you have a huge opportunity to improve the scalability of this by using a non-blocking web framework/library, such as Playhttp://www.playframework.com/or Spray http://spray.io/. From our experience, if we have many many small packets (100 bytes) it is better to accumulate (typically up to 2-3 Kb) and then flush. If there are aprox 40 threads blocked we also flush to increase tomcat throughput. So, depending of the application scenario on or other criteria will apply with more or less relevance. Until now a good choice of the 'magic numbers' solves the problem with very good results. I'm wondering if this criteria applies to Akka or not. Maybe Akka solves this kind of problem automatically auto-adapting itself to the better combination. When using akka remoting, the serialized representation of the messages are sent without any batching. I couldn't find the right way to go on after reading the docs Dispatchers, Routers, and mailboxes, (and also I'm a novice Akka user). I'm not sure I understand what you are trying to do and why, but one solution might be to pass the messages via an actor that is responsible for the buffering and flushing. Maybe it is what we need. Is out there some example of this kind of actor doing both things (buffering and flushing to the wire) the pending packets? It sounds that is exactly what we want. Take a look at the Buncher examplehttp://doc.akka.io/docs/akka/2.3.0/scala/fsm.html#A_Simple_Example . It is using FSM, which doesn't exist in the Java7 API of Akka. in case you are not using Scala or Java8 you can implement that with an ordinary actor as well. If you want to go more low level and have full control you can use Akka I/Ohttp://doc.akka.io/docs/akka/2.3.0/scala/io.htmlinstead of Akka remoting. Thanks Patrik again for your time and for dedicating calories to understand so many different scenarios. You're welcome. /Patrik Best regards, Regards, Patrik Many thanks for your help and suggestions. Best regards, Eduardo. -- 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 http://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 --
Re: [akka-user] Akka Consistent Hashing Router
I am using akka 2.3.0 and this is how i am creating the CHR. So my req is that which ever message went to a routee of TestConnActor they should all be consolidated as list in the Aggregator actor. So if message 1 and 2 made it to TestConnActor routee1 and message 3 and 4 made it to TestConnActor routee2 then when the messages 1 and 2 should reach the same routee of the Aggregator actor. Please suggest me if its doable with CHR. TestHashMapper just uses one of the incoming message's id and returns that as hash key. TestHashMapper hashMapper =*new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestConnActor.*class*).withRouter(*new* *ConsistentHashingRouter( new Integer(3))*.*withHashMapper(hashMapper)*), TestQuant ); actorSystem().actorOf(Props.*create*(TestEventAggregator.*class* ).withRouter(*new* *ConsistentHashingRouter( new Integer(3))*. *withHashMapper(hashMapper)*), TestAgg ); actorSystem().actorOf(Props.*create*(TestBulkActor.*class*).withRouter(*new* *ConsistentHashingRouter( new Integer(3))*.*withHashMapper(hashMapper)*), TestBulk ); ActorRef single = actorSystem().actorOf(*new*RoundRobinPool(3).props(Props. *create*(TestSingleActor.*class*)), TestSingle); ~ On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote: What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M send...@gmail.comjavascript: wrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another actor with another CHR. The messages are going to different routees for the same hash key. Can someone please explain how the consistent hashing router is implemented? What are the factors it uses to build the hashing and how it routes? -- 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 javascript:. To post to this group, send email to akka...@googlegroups.comjavascript: . Visit this group at http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] Re: Replay Intro to Akka persistence with Patrik Nordwall
Thank you so much! On Thursday, March 20, 2014 7:41:34 AM UTC+8, James wrote: I missed the live, is this going to be available on Yotube? -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Remote deployment PropsData design?
Hi Roger, On Mon, Mar 17, 2014 at 2:34 PM, Roger Alsing rogerals...@gmail.com wrote: This is related to my first question regarding remote deployment protobuf message. The DaemonMsgCreateData has a PropsData, which in turn holds a list of args that is needed in order to create the actor instance on the remote node. This is accomplished using two repeated fields, args and classes. Which makes up the serialized data for each arg and the fqcn of each arg. This differs from the design of for example SerializedMessage , which has a payload message and an int serializerId and a messageManifest Is there any reason why this distinction is made? Wouldn't it be more consistent with the overall API design if the args had a repeated message similar to SerializedMessage ? Yes, that might be possible. I don't know if there is a reason for the difference. I'm not saying this is a bug nor that it affects any functionallity, I just found it somewhat odd. How is null handled if used in this arg list? is null a special type in Scala and the fqcn will be of the special null type? (assuming that you have an actor that can take null for some ctor argument that is..) Good point. null argument is not taken care of. I have created a ticket for that: https://www.assembla.com/spaces/akka/tickets/3946 Thanks, Patrik //Roger -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] Re: How to test that an actor sends a message to another actor
I ended up changing my DoWorkActor like this: class DoWorkActor(managerRef: Option[ActorRef] = None) extends Actor { lazy val managerSel = context.system.actorSelection(user/manager) def receive = { case go = { // do some work tellManager(success) } } def tellManager(msg: Any) = { managerRef match { case None = managerSel ! msg case _ = managerRef.get ! msg } } Then I changed my test to extend TestKit and now when I create an instance of DoWorkActor, I pass in the testActor provided by the TestKit reference: http://blog.matthieuguillermin.fr/2013/06/akka-testing-your-actors/ On Thursday, March 20, 2014 8:10:06 AM UTC-4, Craig Wickesser wrote: I am using Scala 2.9.2 and Akka 2.0.x. I have two actors: class DoWorkActor extends Actor { val manager = context.system.ActorSelection(user/manager) def receive = { case go = { // do some work manager ! success } } } class ManagerActor extends Actor { var successCount = 0 def receive = { case success = { successCount += 1 } case getSuccessCount = { sender ! successCount } } } I want to verify that the DoWorkActor sends a success to the ManagerActor. I'm trying with the following test: class DoWorkActorSpec extends FunSpec { val config = ConfigFactory.load() implicit val actorSystem = ActorSystem(test, config) implicit val timeout = Timeout(500) val managerRef = TestActorRef(new ManagerActor) actorSystem.actorOf(Props(managerRef.underlyingActor), name = manager) describe(#receive) { it(should send a success message to the manager) { val doWorkActor = TestActorRef(new DoWorkActor) doWorkActor ! go val count = Await.result((managerRef ? getSuccessCount), 5 seconds) assert(count === 1) } } Somtimes this test passes, but usually it fails. I put println statements in the Manger actor and I can see that it usually gets the getSuccessCount message before the success message. If I put in a Thread.sleep(100) after sending the go message to the DoWorkActor, the test passes. I thought by using TestActorRef's, things would be asynchronous but it seems like they're not. Am I doing something wrong? Any suggestions? Thanks. -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: How to test that an actor sends a message to another actor
That looks better. Consider if it be possible to always pass in the managerRef: ActorRef instead of using actorSelection. By the way, the actorSelection should probably be /user/manager I would use TestActorRef only in very special cases. In fact, I have not found a reason to use it one single time in my 3 years of Akka programming. /Patrik On Thu, Mar 20, 2014 at 3:11 PM, Craig Wickesser codecr...@gmail.comwrote: I ended up changing my DoWorkActor like this: class DoWorkActor(managerRef: Option[ActorRef] = None) extends Actor { lazy val managerSel = context.system.actorSelection(user/manager) def receive = { case go = { // do some work tellManager(success) } } def tellManager(msg: Any) = { managerRef match { case None = managerSel ! msg case _ = managerRef.get ! msg } } Then I changed my test to extend TestKit and now when I create an instance of DoWorkActor, I pass in the testActor provided by the TestKit reference: http://blog.matthieuguillermin.fr/2013/06/akka-testing-your-actors/ On Thursday, March 20, 2014 8:10:06 AM UTC-4, Craig Wickesser wrote: I am using Scala 2.9.2 and Akka 2.0.x. I have two actors: class DoWorkActor extends Actor { val manager = context.system.ActorSelection(user/manager) def receive = { case go = { // do some work manager ! success } } } class ManagerActor extends Actor { var successCount = 0 def receive = { case success = { successCount += 1 } case getSuccessCount = { sender ! successCount } } } I want to verify that the DoWorkActor sends a success to the ManagerActor. I'm trying with the following test: class DoWorkActorSpec extends FunSpec { val config = ConfigFactory.load() implicit val actorSystem = ActorSystem(test, config) implicit val timeout = Timeout(500) val managerRef = TestActorRef(new ManagerActor) actorSystem.actorOf(Props(managerRef.underlyingActor), name = manager) describe(#receive) { it(should send a success message to the manager) { val doWorkActor = TestActorRef(new DoWorkActor) doWorkActor ! go val count = Await.result((managerRef ? getSuccessCount), 5 seconds) assert(count === 1) } } Somtimes this test passes, but usually it fails. I put println statements in the Manger actor and I can see that it usually gets the getSuccessCount message before the success message. If I put in a Thread.sleep(100) after sending the go message to the DoWorkActor, the test passes. I thought by using TestActorRef's, things would be asynchronous but it seems like they're not. Am I doing something wrong? Any suggestions? Thanks. -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Akka Consistent Hashing Router
I corrected the deprecated version. Thanks for your help. But still i see the same behavior. So yes i have three Routers set up with 3 different routee sets and my objective to route all the messages with same hashKey to single instance of TestAdaptorActor. So i was trying to build a list with the second Actor with Router using the same key, thinking the list will be built based on the hashkey and so which ever message went to one instance of TestAdaptorActor will be added in list. But i found something different. First router guarantees the fact for hashKey it always went to one AdaptorActor. But the messages which were processed by AdaptorActor were not added in the same list as Aggregater's routees are different. So does it mean that if the the routee's actors are different then messages wont go to the same routee instance even if i use Consistent HashMapping with the same mapper and key? Please let me know. If this is not possible i have to change my actors to do accordingly. Your suggestions will help. Thanks again. TestHashMapper hashMapper = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestAdaptorActor.*class*).withRouter( *new* ConsistentHashingPool( *new* Integer(3)).withHashMapper(hashMapper)), TestQuant ); TestHashMapper hashMapper1 = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestEventAggregator.*class* ).withRouter(*new* ConsistentHashingPool( *new*Integer(3)).withHashMapper(hashMapper1)), TestAgg ); TestHashMapper hashMapper2 = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestBulkActor.*class*).withRouter(*new*ConsistentHashingPool( *new* Integer(3)).withHashMapper(hashMapper2)), TestBulk ); ActorRef single = actorSystem().actorOf(*new*RoundRobinPool(3).props(Props. *create*(TestSingleActor.*class*)), TestSingle); *for*(*int* i =1; i=12;i++) { *single*.tell(Integer.*valueOf*(i) , single); } On Thursday, March 20, 2014 8:52:44 AM UTC-4, Patrik Nordwall wrote: On Thu, Mar 20, 2014 at 1:24 PM, Sendhil Kumar M send...@gmail.comjavascript: wrote: I am using akka 2.3.0 and this is how i am creating the CHR. So my req is that which ever message went to a routee of TestConnActor they should all be consolidated as list in the Aggregator actor. So if message 1 and 2 made it to TestConnActor routee1 and message 3 and 4 made it to TestConnActor routee2 then when the messages 1 and 2 should reach the same routee of the Aggregator actor. Please suggest me if its doable with CHR. but TestQuant and TestAgg don't have any routees in common. Both of them create 3 separate routees each. You are using a deprecated API. This is now named ConsistentHashingPool. I think you might be looking for ConsistentHashingGroup. The differences between Pool and Group are described in the documentation: http://doc.akka.io/docs/akka/2.3.0/java/routing.html Take a look at that and let me know if things still are unclear. /Patrik TestHashMapper just uses one of the incoming message's id and returns that as hash key. TestHashMapper hashMapper = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestConnActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestQuant ); actorSystem().actorOf(Props.*create*(TestEventAggregator. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestAgg ); actorSystem().actorOf(Props.*create*(TestBulkActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestBulk ); ActorRef single = actorSystem().actorOf( *new* RoundRobinPool(3).props(Props.*create*(TestSingleActor.*class*)), TestSingle); ~ On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote: What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M send...@gmail.comwrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another
Re: [akka-user] Akka Consistent Hashing Router
Sounds like you don't want consistent hashing: http://en.wikipedia.org/wiki/Consistent_hashing On Thu, Mar 20, 2014 at 4:09 PM, Sendhil Kumar M sendhi...@gmail.comwrote: I read the article on ConsistentHashingGroup but is it possible for me to have different types of routees(Actors) in the group? If so how do i specify which type of actor should get message. Please let me know. On Thursday, March 20, 2014 8:52:44 AM UTC-4, Patrik Nordwall wrote: On Thu, Mar 20, 2014 at 1:24 PM, Sendhil Kumar M send...@gmail.comwrote: I am using akka 2.3.0 and this is how i am creating the CHR. So my req is that which ever message went to a routee of TestConnActor they should all be consolidated as list in the Aggregator actor. So if message 1 and 2 made it to TestConnActor routee1 and message 3 and 4 made it to TestConnActor routee2 then when the messages 1 and 2 should reach the same routee of the Aggregator actor. Please suggest me if its doable with CHR. but TestQuant and TestAgg don't have any routees in common. Both of them create 3 separate routees each. You are using a deprecated API. This is now named ConsistentHashingPool. I think you might be looking for ConsistentHashingGroup. The differences between Pool and Group are described in the documentation: http://doc. akka.io/docs/akka/2.3.0/java/routing.html Take a look at that and let me know if things still are unclear. /Patrik TestHashMapper just uses one of the incoming message's id and returns that as hash key. TestHashMapper hashMapper = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestConnActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestQuant ); actorSystem().actorOf(Props.*create*(TestEventAggregator. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestAgg ); actorSystem().actorOf(Props.*create*(TestBulkActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestBulk ); ActorRef single = actorSystem().actorOf( *new* RoundRobinPool(3).props(Props.*create*(TestSingleActor.*class*)), TestSingle); ~ On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote: What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M send...@gmail.comwrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another actor with another CHR. The messages are going to different routees for the same hash key. Can someone please explain how the consistent hashing router is implemented? What are the factors it uses to build the hashing and how it routes? -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/c urrent/additional/faq.html Search the archives: https://groups.google.com/grou p/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 http://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+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://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
Re: [akka-user] Akka Consistent Hashing Router
Thanks for your suggestion. So if i have two different actors with CHR and there is no guarantee that the messages will be routed to same routee within the CHR's. If thats the case then i got to change my approach. Consistent hasing routing will work only for the same type of actors is it? Please let me know. On Thursday, March 20, 2014 11:18:36 AM UTC-4, √ wrote: Sounds like you don't want consistent hashing: http://en.wikipedia.org/wiki/Consistent_hashing On Thu, Mar 20, 2014 at 4:09 PM, Sendhil Kumar M send...@gmail.comjavascript: wrote: I read the article on ConsistentHashingGroup but is it possible for me to have different types of routees(Actors) in the group? If so how do i specify which type of actor should get message. Please let me know. On Thursday, March 20, 2014 8:52:44 AM UTC-4, Patrik Nordwall wrote: On Thu, Mar 20, 2014 at 1:24 PM, Sendhil Kumar M send...@gmail.comwrote: I am using akka 2.3.0 and this is how i am creating the CHR. So my req is that which ever message went to a routee of TestConnActor they should all be consolidated as list in the Aggregator actor. So if message 1 and 2 made it to TestConnActor routee1 and message 3 and 4 made it to TestConnActor routee2 then when the messages 1 and 2 should reach the same routee of the Aggregator actor. Please suggest me if its doable with CHR. but TestQuant and TestAgg don't have any routees in common. Both of them create 3 separate routees each. You are using a deprecated API. This is now named ConsistentHashingPool. I think you might be looking for ConsistentHashingGroup. The differences between Pool and Group are described in the documentation: http://doc. akka.io/docs/akka/2.3.0/java/routing.html Take a look at that and let me know if things still are unclear. /Patrik TestHashMapper just uses one of the incoming message's id and returns that as hash key. TestHashMapper hashMapper = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestConnActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestQuant ); actorSystem().actorOf(Props.*create*(TestEventAggregator. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestAgg ); actorSystem().actorOf(Props.*create*(TestBulkActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)). *withHashMapper(hashMapper)*), TestBulk ); ActorRef single = actorSystem().actorOf( *new* RoundRobinPool(3).props(Props.*create*(TestSingleActor.*class*)), TestSingle); ~ On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote: What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M send...@gmail.comwrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another actor with another CHR. The messages are going to different routees for the same hash key. Can someone please explain how the consistent hashing router is implemented? What are the factors it uses to build the hashing and how it routes? -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/c urrent/additional/faq.html Search the archives: https://groups.google.com/grou p/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 http://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/
Re: [akka-user] Akka Consistent Hashing Router
On Thu, Mar 20, 2014 at 4:22 PM, Sendhil Kumar M sendhi...@gmail.comwrote: Thanks for your suggestion. So if i have two different actors with CHR and there is no guarantee that the messages will be routed to same routee within the CHR's. If thats the case then i got to change my approach. Consistent hasing routing will work only for the same type of actors is it? Please let me know. No that is not the problem. You can have different types of actors as routees in a Group. The nodes in the hash ring will be keyed on the paths of the routees. Try this: ActorRef a = system.actorOf(Props.create(A.class), a); ActorRef b = system.actorOf(Props.create(B.class), b); ActorRef c = system.actorOf(Props.create(C.class), c); ListString paths = Arrays.asList(/user/a, /user/b, /user/b); ActorRef r1 = system.actorOf(new ConsistentHashingGroup(paths).withHashMapper(hashMapper).props(), r1); ActorRef r2 = system.actorOf(new ConsistentHashingGroup(paths).withHashMapper(hashMapper).props(), r2); With the above setup you can send messages to r1 or r2 and messages with same hashKey should end up in same destination (a, b, c). /Patrik On Thursday, March 20, 2014 11:18:36 AM UTC-4, √ wrote: Sounds like you don't want consistent hashing: http://en.wikipedia. org/wiki/Consistent_hashing On Thu, Mar 20, 2014 at 4:09 PM, Sendhil Kumar M send...@gmail.comwrote: I read the article on ConsistentHashingGroup but is it possible for me to have different types of routees(Actors) in the group? If so how do i specify which type of actor should get message. Please let me know. On Thursday, March 20, 2014 8:52:44 AM UTC-4, Patrik Nordwall wrote: On Thu, Mar 20, 2014 at 1:24 PM, Sendhil Kumar M send...@gmail.comwrote: I am using akka 2.3.0 and this is how i am creating the CHR. So my req is that which ever message went to a routee of TestConnActor they should all be consolidated as list in the Aggregator actor. So if message 1 and 2 made it to TestConnActor routee1 and message 3 and 4 made it to TestConnActor routee2 then when the messages 1 and 2 should reach the same routee of the Aggregator actor. Please suggest me if its doable with CHR. but TestQuant and TestAgg don't have any routees in common. Both of them create 3 separate routees each. You are using a deprecated API. This is now named ConsistentHashingPool. I think you might be looking for ConsistentHashingGroup. The differences between Pool and Group are described in the documentation: http://doc.akka .io/docs/akka/2.3.0/java/routing.html Take a look at that and let me know if things still are unclear. /Patrik TestHashMapper just uses one of the incoming message's id and returns that as hash key. TestHashMapper hashMapper = *new* TestHashMapper(); actorSystem().actorOf(Props.*create*(TestConnActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new*Integer(3)). *withHashMapper(hashMapper)*), TestQuant ); actorSystem().actorOf(Props.*create*(TestEventAggregator. *class*).withRouter(*new* *ConsistentHashingRouter( **new*Integer(3)). *withHashMapper(hashMapper)*), TestAgg ); actorSystem().actorOf(Props.*create*(TestBulkActor. *class*).withRouter(*new* *ConsistentHashingRouter( **new*Integer(3)). *withHashMapper(hashMapper)*), TestBulk ); ActorRef single = actorSystem().actorOf( *new* RoundRobinPool(3).props(Props.*create*(TestSingleActor.*class*)), TestSingle); ~ On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote: What version of Akka are you using? How do you create the CHR? /Patrik On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M send...@gmail.com wrote: I have implemented two CHR where one Router has 20 routees of Actor B and another CHR router with 5 routees and both these Routers uses the Same hashMapper which uses part of the incoming message to build it. Input message: 1 2 3 4 5 Actor A calls CHR of Actor B routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 Now Actor B calls Actor C's CHR using the hash mapper returing the same key. Expected result: routee 1 of Actor B gets 1 and 2 routee 2 of Actor B gets 3 and 4 routee 3 of Actor B gets 5 But i am seeing this. routee 1 of Actor B gets 1 and 3 routee 2 of Actor B gets 2 and 5 routee 3 of Actor B gets 4 I see th CHR is consistently passing the messages with the same key into same actor with a set of routees of same actors. But i am not seeing the same messages going to one routee of another actor with another CHR. The messages are going to different routees for the same hash key. Can someone please explain how the consistent hashing router is implemented? What are the factors it uses to build the hashing and how it routes? -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/c urrent/additional/faq.html Search the archives:
[akka-user] Handling failure when distributing work with pull pattern
I'm looking at using the Pull Pattern (such as described at http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2), with workers explicitly requesting work from a master. While the master handles worker failures by rescheduling jobs, I'm wondering what are typical techniques used to handle master failures. For example, the workers could add the master to their DeathWatch, and then try to reregister if the master dies and restarts. Are there other, better approaches people use? _jonas -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Cluster/remote pipeline strategy
Many thanks Patrik for the info!! I'll check the links you mentioned. I think you're right, the frameworks could improve a lot our performance. Best regards!! El jueves, 20 de marzo de 2014 13:13:28 UTC+1, Patrik Nordwall escribió: On Thu, Mar 20, 2014 at 12:25 PM, Eduardo Fernandes edu...@gmail.comjavascript: wrote: El jueves, 20 de marzo de 2014 09:44:28 UTC+1, Patrik Nordwall escribió: Hi Eduardo, Many thanks for your time, Patrik. On Thu, Mar 20, 2014 at 12:04 AM, Eduardo Fernandes edu...@gmail.comwrote: Hi all. We have a system where we've implemented a pipeline strategy as follows: The idea is move our current architecture to Akka. Taking into consideration that the Akka cluster technology abstracts almost everything related to where the actors are and how many pending messages exist to a particular physical host, etc. That is not true. Akka cluster is essentially cluster membership, including failure detection. Several tools, such as cluster aware routers, are provided on top of this, but you have full control of where and how to run the actors when you need that. Gotcha. What I couldn't find is, for example, flush all mailboxes to actors in a particular host. The idea is to optimize the packets on the wire with a single shot with as many as pending commands as possible to a particular physical node. In fact I don't know exactly how to flush pending commands to the wire. I'm sure it is because I don't heavy enough knowledge about Akka yet. my question is: Is the internal Akka net pipeline more or less equivalent to our one or, in case of not, could I plug in something similar our current pipeline into Akka? We've found that the three criteria aforementioned enabled us to adjust our current technology to a wide range of customer requirements. To give me a more clear picture, can you give some example of what this solves. We're calling Akka actors from a farm of tomcat's (hundreds) where each tomcat manages 5.000 - 9.000 concurrent users. To achieve this we have a competition criteria to flush the pending net packages (we, currently, manage byte arrays) which accumulates many pending user commands. As we need, in many cases, the response of the async cal, we need to block the thread waiting for the response. So the criteria to flush the packets to the wire is a combination of : total number of threads blocked, total volume of data pending to be sent and a max timeout. Sounds like you have a huge opportunity to improve the scalability of this by using a non-blocking web framework/library, such as Playhttp://www.playframework.com/or Spray http://spray.io/. From our experience, if we have many many small packets (100 bytes) it is better to accumulate (typically up to 2-3 Kb) and then flush. If there are aprox 40 threads blocked we also flush to increase tomcat throughput. So, depending of the application scenario on or other criteria will apply with more or less relevance. Until now a good choice of the 'magic numbers' solves the problem with very good results. I'm wondering if this criteria applies to Akka or not. Maybe Akka solves this kind of problem automatically auto-adapting itself to the better combination. When using akka remoting, the serialized representation of the messages are sent without any batching. I couldn't find the right way to go on after reading the docs Dispatchers, Routers, and mailboxes, (and also I'm a novice Akka user). I'm not sure I understand what you are trying to do and why, but one solution might be to pass the messages via an actor that is responsible for the buffering and flushing. Maybe it is what we need. Is out there some example of this kind of actor doing both things (buffering and flushing to the wire) the pending packets? It sounds that is exactly what we want. Take a look at the Buncher examplehttp://doc.akka.io/docs/akka/2.3.0/scala/fsm.html#A_Simple_Example . It is using FSM, which doesn't exist in the Java7 API of Akka. in case you are not using Scala or Java8 you can implement that with an ordinary actor as well. If you want to go more low level and have full control you can use Akka I/O http://doc.akka.io/docs/akka/2.3.0/scala/io.html instead of Akka remoting. Thanks Patrik again for your time and for dedicating calories to understand so many different scenarios. You're welcome. /Patrik Best regards, Regards, Patrik Many thanks for your help and suggestions. Best regards, Eduardo. -- 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
Re: [akka-user] Handling failure when distributing work with pull pattern
On Thu, Mar 20, 2014 at 7:49 PM, √iktor Ҡlang viktor.kl...@gmail.comwrote: Yeah, using Death Watch is appropriate. One solution: if you use Akka Cluster then it is easy to find the next master deterministially by just scanning the membership list in order and using the first node that has an appropriate role. If you mean cluster singleton, the order is oldest member. In upcoming 2.3.1 we will even have a proxy actor that takes care of that part. /Patrik On Thu, Mar 20, 2014 at 7:39 PM, Jonas K thejo...@gmail.com wrote: I'm looking at using the Pull Pattern (such as described at http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2), with workers explicitly requesting work from a master. While the master handles worker failures by rescheduling jobs, I'm wondering what are typical techniques used to handle master failures. For example, the workers could add the master to their DeathWatch, and then try to reregister if the master dies and restarts. Are there other, better approaches people use? _jonas -- 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Cheers, √ * ——— **Viktor Klang* *Chief Architect - **Typesafe http://www.typesafe.com/* Twitter: @viktorklang -- 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 http://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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.