Re: [akka-user] Unable to download latest official version from akka.io
Distribution files have been uploaded to the correct locations. http://downloads.typesafe.com/akka/akka_2.11-2.3.4.zip http://downloads.typesafe.com/akka/akka_2.10-2.3.4.zip /Patrik On Mon, Jun 30, 2014 at 5:00 PM, Odd Möller odd.mol...@gmail.com wrote: Thanks Patrik! Do you have a direct link to the Scala 2.11 targeted 2.3.4 download as well? Greetings Odd On Mon, Jun 30, 2014 at 4:34 PM, Patrik Nordwall patrik.nordw...@gmail.com wrote: Hi Odd, Thanks for reporting. It is something wrong with the naming somewhere. I will investigate. The distribution was uploaded to http://downloads.typesafe.com/akka/akka-2.3.4.zip On Mon, Jun 30, 2014 at 4:23 PM, Odd Möller odd.mol...@gmail.com wrote: Hi! I am unable to download (access denied) the latest official version from the akka.io website: http://downloads.typesafe.com/akka/akka-2.3.4_2.10.zip http://downloads.typesafe.com/akka/akka-2.3.4_2.11.zip Greetings Odd -- 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. -- 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] scala 2.10 using akka-actor problem
Hi I am trying to akka-actor in scala 2.10, and find out scala-2.10 contains akka-actor-2.1.x, is there a way to use a higher version of akka-actor ? and another problem is that, I always meet with this exception, it seems akka needs all configuration keys configed ?? Exception: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.remote.startup-timeout' at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:115) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:136) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:142) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:142) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:150) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:155) at com.typesafe.config.impl.SimpleConfig.getConfigNumber(SimpleConfig.java:170) at com.typesafe.config.impl.SimpleConfig.getNumber(SimpleConfig.java:176) at com.typesafe.config.impl.SimpleConfig.getLong(SimpleConfig.java:187) at com.typesafe.config.impl.SimpleConfig.getNanoseconds(SimpleConfig.java:248) at com.typesafe.config.impl.SimpleConfig.getMilliseconds(SimpleConfig.java:239) at akka.remote.RemoteSettings.init(RemoteSettings.scala:35) at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:113) 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] actor restart itself ?
Hi Bruce, have you read this section of the documentation? http://doc.akka.io/docs/akka/2.3.4/scala/logging.html On Tue, Jul 1, 2014 at 12:21 PM, bruce sha lbao...@gmail.com wrote: I recorded a val named 'startTime' in my actor, when i run the akka , it recorded the start time. but After a while, when i see it again, the 'startTime' change! i checked the log file , i can't find anything error. it seems the actor itself restarted , this's why ? class MyActor extends Actor { val startTime =new Date } -- 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, √ -- 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: Akka Cluster seed node problem
It is not an ERROR. It is logged at INFO level. Do you see in the log if the nodes have joined successfully? You should see things like Node ... is JOINING Welcome from ... Leader is moving node... /Patrik On Mon, Jun 30, 2014 at 6:51 PM, Rohit Kumar Gupta rohitkumargupt...@gmail.com wrote: Patrik, Do you have answer for the below problem ? Any help will be greatly appreciated. Thanks, Rohit On Monday, June 30, 2014 9:42:41 PM UTC+5:30, Rohit Kumar Gupta wrote: Now all three processes are started (master,worker frontend) on three different ports. But I am getting the below error. [INFO] [07/01/2014 00:07:18.695] [Workers-akka.actor.default-dispatcher-4] [akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess] Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp:// Workers@172.16.144.66:2552/system/cluster/core/daemon#-450702087] to Actor[akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess#1270182348] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'. [INFO] [07/01/2014 00:07:18.699] [Workers-akka.actor.default-dispatcher-7] [akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess] Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp:// Workers@172.16.144.66:2551/system/cluster/core/daemon#-1993872094] to Actor[akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess#1270182348] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'. This is causing the frontend to not submit job to the master and nothing is happening. -- 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 Java future onComplete and onFailure syntax . Not compiling using doc example.
Did you import it properly? API docs are here: http://doc.akka.io/japi/akka/2.3.4/?_ga=1.248190663.1579561034.1353497989 On Tue, Jul 1, 2014 at 2:00 PM, claude hussenet chusse...@gmail.com wrote: Have no problem to implement the onSuccess method based on the doc ,but getting compilation issue for the onComplete and onFailure. // THE FOLLOWING COMPILE AND WORKS final FutureActorRef ft = remoteActor.resolveOne(timeout); ExecutionContext ec = system.dispatcher(); ft.onSuccess(new OnSuccessActorRef() { public void onSuccess(ActorRef remoteActor) throws Exception { // DO SOME WORK HERE } }, ec); //THE FOLLOWING TOOK DOES NOT COMPILE ..GETTING ERROR OnComplete can not be resolved to a type ft.onComplete(new OnComplete ActorRef () { public void onComplete(Throwable failure, ActorRef remoteRef) { if (failure != null) { //We got a failure, handle it here } else { // We got a result, do something with it } } }, ec); -- 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, √ -- 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] Akka Java : Supervisor strategy
I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system).props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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 Java : Supervisor strategy
On Tue, Jul 1, 2014 at 2:57 PM, Yadukrishnan K yadava...@gmail.com wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system).props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell((emp != null) ? new EmployeeFound(emp) : new NoSuchEmployee(id), self()); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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, √ -- 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: Akka Java : Supervisor strategy
So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system).props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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: Akka Java : Supervisor strategy
Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com javascript: wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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.com javascript:. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Cheers, √ -- 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: Akka Java : Supervisor strategy
Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yadava...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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, √ -- 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] scala 2.10 using akka-actor problem
You should use a build tool, such as sbt or maven, to define dependencies. With Scala 2.10 (and 2.11) you can use latest Akka 2.3.4. http://doc.akka.io/docs/akka/2.3.4/intro/getting-started.html A good starting point is the Typesafe Activator templates, which also includes sbt build files. http://akka.io/downloads/ Default remote configuration is included in the akka-remote artifact. Cheers, Patrik On Tue, Jul 1, 2014 at 11:41 AM, Sandy Guo yanli@hulu.com wrote: Hi I am trying to akka-actor in scala 2.10, and find out scala-2.10 contains akka-actor-2.1.x, is there a way to use a higher version of akka-actor ? and another problem is that, I always meet with this exception, it seems akka needs all configuration keys configed ?? Exception: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.remote.startup-timeout' at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:115) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:136) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:142) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:142) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:150) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:155) at com.typesafe.config.impl.SimpleConfig.getConfigNumber(SimpleConfig.java:170) at com.typesafe.config.impl.SimpleConfig.getNumber(SimpleConfig.java:176) at com.typesafe.config.impl.SimpleConfig.getLong(SimpleConfig.java:187) at com.typesafe.config.impl.SimpleConfig.getNanoseconds(SimpleConfig.java:248) at com.typesafe.config.impl.SimpleConfig.getMilliseconds(SimpleConfig.java:239) at akka.remote.RemoteSettings.init(RemoteSettings.scala:35) at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:113) 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] Re: Akka Java : Supervisor strategy
Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com javascript: wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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.com javascript:. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Cheers, √ -- 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
Re: [akka-user] Re: Akka Java : Supervisor strategy
send message where? http://doc.akka.io/docs/akka/2.3.4/scala/fault-tolerance.html On Tue, Jul 1, 2014 at 3:58 PM, Yadukrishnan K yadava...@gmail.com wrote: Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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. -- Cheers, √ -- 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] Re: Akka Java : Supervisor strategy
If any exception happened, say SQL Exception, I would like to return a message, like SOME_ERROR, so that the caller understand that some problem occurred and show relevant message. Currently, when an exception occurs, sender().tell() will not execute due to exception and Future Timeout happens. Is my method not correct ? On Tuesday, July 1, 2014 7:30:58 PM UTC+5:30, √ wrote: send message where? http://doc.akka.io/docs/akka/2.3.4/scala/fault-tolerance.html On Tue, Jul 1, 2014 at 3:58 PM, Yadukrishnan K yada...@gmail.com javascript: wrote: Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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
Re: [akka-user] Re: Akka Java : Supervisor strategy
If you don't want to restart the child you'll want to catch the exception and send another response to the sender. On Tue, Jul 1, 2014 at 4:05 PM, Yadukrishnan K yadava...@gmail.com wrote: If any exception happened, say SQL Exception, I would like to return a message, like SOME_ERROR, so that the caller understand that some problem occurred and show relevant message. Currently, when an exception occurs, sender().tell() will not execute due to exception and Future Timeout happens. Is my method not correct ? On Tuesday, July 1, 2014 7:30:58 PM UTC+5:30, √ wrote: send message where? http://doc.akka.io/docs/akka/2.3.4/scala/fault-tolerance.html On Tue, Jul 1, 2014 at 3:58 PM, Yadukrishnan K yada...@gmail.com wrote: Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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
Re: [akka-user] Re: Akka Java : Supervisor strategy
Yes. On Tue, Jul 1, 2014 at 4:31 PM, Yadukrishnan K yadava...@gmail.com wrote: But, if I implement supervisor, I have to return restart, stop or escalate right. On 01-Jul-2014 7:40 PM, √iktor Ҡlang viktor.kl...@gmail.com wrote: If you don't want to restart the child you'll want to catch the exception and send another response to the sender. On Tue, Jul 1, 2014 at 4:05 PM, Yadukrishnan K yadava...@gmail.com wrote: If any exception happened, say SQL Exception, I would like to return a message, like SOME_ERROR, so that the caller understand that some problem occurred and show relevant message. Currently, when an exception occurs, sender().tell() will not execute due to exception and Future Timeout happens. Is my method not correct ? On Tuesday, July 1, 2014 7:30:58 PM UTC+5:30, √ wrote: send message where? http://doc.akka.io/docs/akka/2.3.4/scala/fault-tolerance.html On Tue, Jul 1, 2014 at 3:58 PM, Yadukrishnan K yada...@gmail.com wrote: Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- Read the docs: http://akka.io/docs/ Check the FAQ:
Re: [akka-user] Re: Akka Java : Supervisor strategy
But, if I implement supervisor, I have to return restart, stop or escalate right. On 01-Jul-2014 7:40 PM, √iktor Ҡlang viktor.kl...@gmail.com wrote: If you don't want to restart the child you'll want to catch the exception and send another response to the sender. On Tue, Jul 1, 2014 at 4:05 PM, Yadukrishnan K yadava...@gmail.com wrote: If any exception happened, say SQL Exception, I would like to return a message, like SOME_ERROR, so that the caller understand that some problem occurred and show relevant message. Currently, when an exception occurs, sender().tell() will not execute due to exception and Future Timeout happens. Is my method not correct ? On Tuesday, July 1, 2014 7:30:58 PM UTC+5:30, √ wrote: send message where? http://doc.akka.io/docs/akka/2.3.4/scala/fault-tolerance.html On Tue, Jul 1, 2014 at 3:58 PM, Yadukrishnan K yada...@gmail.com wrote: Using supervisor, I will be able to restart the failed actor, using restart(), stop() etc right? But Can I send message ? Can you please point me to a sample code for my case? I am really getting confused with this. On Tuesday, July 1, 2014 7:15:19 PM UTC+5:30, √ wrote: Execute the SQL in a newly created child-actor and use supervision to deal with the exception? On Tue, Jul 1, 2014 at 3:43 PM, Yadukrishnan K yada...@gmail.com wrote: Thanks for the quick reply. But how do I handle the Exceptions at a common place instead of try-catch in each of the actors? (like SQL Exceptions ) On Tuesday, July 1, 2014 6:48:17 PM UTC+5:30, √ wrote: I'd recommend against using Exceptions for validation. The non-existence of an Employee is a natural thing given an arbitrary id—it is not exceptional. On Tue, Jul 1, 2014 at 3:08 PM, Yadukrishnan K yada...@gmail.com wrote: So do I have to do it in each of the actors ? Is there any other way to handle it in a central place? For ex: in Spring MVC, all the exceptions thrown from the controller can be handled using @ControllerAdvice. Just looking if there is any similar thing. Not just this, I want to handle any SQLExceptions like Constraint Violation and return a meaningful message to the caller. For that also, I need to use try-catch in each of the actors and send corresponding message ? On Tuesday, July 1, 2014 6:27:42 PM UTC+5:30, Yadukrishnan K wrote: I am a newbie to akka actor system. I am developing an application using Java, Spring, Hibernate and Akka. I am having problems with exception handling. My scenario is given below : REST API -- Spring MVC -- Service Layer (Actor) -- Hibernate Repository. Assume that I am trying to find an employee with id 1. Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); If the employee with id=1 doesn't exist, the emp object will be NULL and sending NULL as message will throw InvalidMessageException. Is it possible to handle this exception and throw a custom Exception to the caller, say NoEntityFoundException? This help me to check if the result I obtained is of Employee or CustomException. Currently, I am getting Future timeout only. I have a BaseActor which extends akka.actor.AbstractActor. I also have another class, BaseModuleActor which extends BaseActor, as shown below. public class BaseModuleActor extends BaseActor { public T ActorRef getActorRef(ActorSystem system,ClassT clazz){ return system.actorOf( SpringExtension.SpringExtProvider.get(system). props(clazz)); } } All my actors are extending this actor, where I am doing like below @Override public PartialFunctionObject, BoxedUnit receive(){ return ReceiveBuilder .match(Long.class, id- getEmployeeById(id)) .build() .orElse(matchAny()); } private void getEmployeeById(Long id){ Employee emp = HibernateRepository.findById(Employee.class, id); sender().tell(emp, self()); } But I am now stuck with handling the exceptions at a common place using the supervisor strategy. How can I catch the InvalidMessageException and resends some meaningful message to the caller. Is it possible? Regards, Yadu -- 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. -- Cheers, √ -- 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] Re: Akka 2.3.4 Released - Major updates to Akka Persistence
Nice, thanks :) A small question, the EventsourcedProcessor will be replaced by the PersistentProcessor (as my compile messages tell me :) ) It seems that it's not available in the 2.3.4 source, is that right ? The documentation states the use of the PersistentActor instead of the PersistentProcessor. With my assumption that this is not in 2.3.4 and will be created, what will be the difference ? Next to that, I am using the EventsourcedProcessor with ClusterSharding and use the default processorId. Found a nice mention on how to get persistenceId work in the same way, but maybe there is a way to have the created PersistenceProcessor/Actor make use of a constructor that sets the proper ID (and not to be dependent on the actorPath) Any hints where this is done ? (and if it's possible to manipulate it ?) (My structure is similar as the akka cluster sharding activator template. Kind regards, Olger On Monday, June 30, 2014 2:56:36 PM UTC+2, Patrik Nordwall wrote: Dear hAkkers, We—the Akka committers—are pleased to be able to announce the availability of Akka 2.3.4. This is the fourth maintenance release of the 2.3 branch. This release contains extensive changes to the experimental module Akka Persistence: - Processor and EventsourcedProcessor are deprecated and replaced by PersistentActor - Channel and PersistentChannel are deprecated and replaced by AtLeastOnceDelivery - View is deprecated and replaced by PersistentView The reason for these changes is to simplify the API and reduce the confusion caused by the many overlapping features of the former API. Akka Persistence is not backwards binary compatible with version 2.3.3, i.e. if you use Akka Persistence you must recompile your source code with version 2.3.4 and use libraries (e.g. journal plugins) that have been released for Akka 2.3.4. The changes to Akka Persistence are source backwards compatible with deprecation warnings. Please follow the instructions in the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-persistence-experimental-2.3.x-2.4.x.html#migration-guide-persistence-experimental-2-3-x-2-4-x to update to the latest features of Akka Persistence. Akka 2.3.4 is released for Scala 2.10.4 and 2.11.1. Apart from the Akka Persistence artifact this release is backwards binary compatible with version 2.3.0, 2.3.1, 2.3.2 and 2.3.3 which means that the new JARs are a drop-in replacement for the old one (but not the other way around) as long as your build does not enable the inliner (Scala-only restriction). Always make sure to use at least the latest version required by any of your project’s dependencies. Migrating from Older Releases When migrating an existing project from Akka 2.2.x please have a look at the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-2.2.x-2.3.x.html . Additional Release Details The artifacts comprising this release have been published to https://oss.sonatype.org/content/repositories/releases/ and also to Maven Central. In addition, we adopted the sbt standard of encoding the Scala binary version in the artifact name, i.e. the core actor package’s artifactId is “akka-actor_2.10”. The complete list of closed tickets can be found in the 2.3.4 github issues milestone https://github.com/akka/akka/issues?milestone=10state=closed. Credits commits added removed 1948562884 Patrik Nordwall 1130021265 Konrad 'ktoso' Malawski 9 514 105 Björn Antonsson 1 154 9 Martynas Mickevicius 1 29 10 Jeroen Gordijn 1 14 1 Johannes Rudolph 1 52 5 Marcin Kubala 1 24 0 Konrad Malawski 1 73 1 Csongor Somogyi 1 2 2 André Wolski *Happy hAkking!* -- 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: Akka 2.3.4 Released - Major updates to Akka Persistence
Let's continue with questions at akka-user. /Patrik On Tue, Jul 1, 2014 at 5:53 PM, Olger Warnier ol...@spectare.nl wrote: Nice, thanks :) A small question, the EventsourcedProcessor will be replaced by the PersistentProcessor (as my compile messages tell me :) ) It seems that it's not available in the 2.3.4 source, is that right ? The documentation states the use of the PersistentActor instead of the PersistentProcessor. With my assumption that this is not in 2.3.4 and will be created, what will be the difference ? Next to that, I am using the EventsourcedProcessor with ClusterSharding and use the default processorId. Found a nice mention on how to get persistenceId work in the same way, but maybe there is a way to have the created PersistenceProcessor/Actor make use of a constructor that sets the proper ID (and not to be dependent on the actorPath) Any hints where this is done ? (and if it's possible to manipulate it ?) (My structure is similar as the akka cluster sharding activator template. Kind regards, Olger On Monday, June 30, 2014 2:56:36 PM UTC+2, Patrik Nordwall wrote: Dear hAkkers, We—the Akka committers—are pleased to be able to announce the availability of Akka 2.3.4. This is the fourth maintenance release of the 2.3 branch. This release contains extensive changes to the experimental module Akka Persistence: - Processor and EventsourcedProcessor are deprecated and replaced by PersistentActor - Channel and PersistentChannel are deprecated and replaced by AtLeastOnceDelivery - View is deprecated and replaced by PersistentView The reason for these changes is to simplify the API and reduce the confusion caused by the many overlapping features of the former API. Akka Persistence is not backwards binary compatible with version 2.3.3, i.e. if you use Akka Persistence you must recompile your source code with version 2.3.4 and use libraries (e.g. journal plugins) that have been released for Akka 2.3.4. The changes to Akka Persistence are source backwards compatible with deprecation warnings. Please follow the instructions in the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-persistence-experimental-2.3.x-2.4.x.html#migration-guide-persistence-experimental-2-3-x-2-4-x to update to the latest features of Akka Persistence. Akka 2.3.4 is released for Scala 2.10.4 and 2.11.1. Apart from the Akka Persistence artifact this release is backwards binary compatible with version 2.3.0, 2.3.1, 2.3.2 and 2.3.3 which means that the new JARs are a drop-in replacement for the old one (but not the other way around) as long as your build does not enable the inliner (Scala-only restriction). Always make sure to use at least the latest version required by any of your project’s dependencies. Migrating from Older Releases When migrating an existing project from Akka 2.2.x please have a look at the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-2.2.x-2.3.x.html . Additional Release Details The artifacts comprising this release have been published to https://oss.sonatype.org/content/repositories/releases/ and also to Maven Central. In addition, we adopted the sbt standard of encoding the Scala binary version in the artifact name, i.e. the core actor package’s artifactId is “akka-actor_2.10”. The complete list of closed tickets can be found in the 2.3.4 github issues milestone https://github.com/akka/akka/issues?milestone=10state=closed. Credits commits added removed 1948562884 Patrik Nordwall 1130021265 Konrad 'ktoso' Malawski 9 514 105 Björn Antonsson 1 154 9 Martynas Mickevicius 1 29 10 Jeroen Gordijn 1 14 1 Johannes Rudolph 1 52 5 Marcin Kubala 1 24 0 Konrad Malawski 1 73 1 Csongor Somogyi 1 2 2 André Wolski *Happy hAkking!* -- 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. -- 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
Re: [akka-user] Re: Akka 2.3.4 Released - Major updates to Akka Persistence
On Tue, Jul 1, 2014 at 6:05 PM, Patrik Nordwall patrik.nordw...@gmail.com wrote: Let's continue with questions at akka-user. /Patrik On Tue, Jul 1, 2014 at 5:53 PM, Olger Warnier ol...@spectare.nl wrote: Nice, thanks :) A small question, the EventsourcedProcessor will be replaced by the PersistentProcessor (as my compile messages tell me :) ) It seems that it's not available in the 2.3.4 source, is that right ? The documentation states the use of the PersistentActor instead of the PersistentProcessor. With my assumption that this is not in 2.3.4 and will be created, what will be the difference ? That is a typo in the deprecation message. It is supposed to be PersistentActor. It is the replacement for both Processor and EventsourcedProcessor. Next to that, I am using the EventsourcedProcessor with ClusterSharding and use the default processorId. Found a nice mention on how to get persistenceId work in the same way, but maybe there is a way to have the created PersistenceProcessor/Actor make use of a constructor that sets the proper ID (and not to be dependent on the actorPath) Any hints where this is done ? (and if it's possible to manipulate it ?) (My structure is similar as the akka cluster sharding activator template. I would recommend: // self.path.parent.name is the type name (utf-8 URL-encoded) // self.path.name is the entry identifier (utf-8 URL-encoded) override def persistenceId: String = self.path.parent.name + - + self.path.name Regards, Patrik Kind regards, Olger On Monday, June 30, 2014 2:56:36 PM UTC+2, Patrik Nordwall wrote: Dear hAkkers, We—the Akka committers—are pleased to be able to announce the availability of Akka 2.3.4. This is the fourth maintenance release of the 2.3 branch. This release contains extensive changes to the experimental module Akka Persistence: - Processor and EventsourcedProcessor are deprecated and replaced by PersistentActor - Channel and PersistentChannel are deprecated and replaced by AtLeastOnceDelivery - View is deprecated and replaced by PersistentView The reason for these changes is to simplify the API and reduce the confusion caused by the many overlapping features of the former API. Akka Persistence is not backwards binary compatible with version 2.3.3, i.e. if you use Akka Persistence you must recompile your source code with version 2.3.4 and use libraries (e.g. journal plugins) that have been released for Akka 2.3.4. The changes to Akka Persistence are source backwards compatible with deprecation warnings. Please follow the instructions in the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-persistence-experimental-2.3.x-2.4.x.html#migration-guide-persistence-experimental-2-3-x-2-4-x to update to the latest features of Akka Persistence. Akka 2.3.4 is released for Scala 2.10.4 and 2.11.1. Apart from the Akka Persistence artifact this release is backwards binary compatible with version 2.3.0, 2.3.1, 2.3.2 and 2.3.3 which means that the new JARs are a drop-in replacement for the old one (but not the other way around) as long as your build does not enable the inliner (Scala-only restriction). Always make sure to use at least the latest version required by any of your project’s dependencies. Migrating from Older Releases When migrating an existing project from Akka 2.2.x please have a look at the migration guide http://doc.akka.io/docs/akka/2.3.4/project/migration-guide-2.2.x-2.3.x.html . Additional Release Details The artifacts comprising this release have been published to https://oss.sonatype.org/content/repositories/releases/ and also to Maven Central. In addition, we adopted the sbt standard of encoding the Scala binary version in the artifact name, i.e. the core actor package’s artifactId is “akka-actor_2.10”. The complete list of closed tickets can be found in the 2.3.4 github issues milestone https://github.com/akka/akka/issues?milestone=10state=closed. Credits commits added removed 1948562884 Patrik Nordwall 1130021265 Konrad 'ktoso' Malawski 9 514 105 Björn Antonsson 1 154 9 Martynas Mickevicius 1 29 10 Jeroen Gordijn 1 14 1 Johannes Rudolph 1 52 5 Marcin Kubala 1 24 0 Konrad Malawski 1 73 1 Csongor Somogyi 1 2 2 André Wolski *Happy hAkking!* -- 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.
[akka-user] Re: Learning Akka with Akka Concurrency book
Apart from a couple of substantial differences in the API syntax (essentially the actorSelection method) and missing akka-persistence and clustering (which are not beginners topics anyway), I'd suggest you read through Wyatt's book anyway. The philosophy behind the actor model and messaging and almost all the basic tenets (e.g. supervision, failure handling, testing) examined by the book are still unchanged, and I think it's a really good read to grasp the subject. If you need updated information, I heartily suggest the reference documentation, which is one of the best I've seen, ever. If you're in the mood, I won't discourage you to read other books on the subject, of course. Bye Ivano On Wednesday, June 25, 2014 1:29:05 AM UTC+2, Yawz wrote: Hi all, I'm learning Akka by reading Derek Wyatt's Akka Concurrency. I'm going through the 4th chapter and I'm already noticing that the API has changed since the publication of the book. What's the best up-to-date resource you could recommend (book or Web site) for beginners? Thank you. -- 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: Akka 2.3.4 Released - Major updates to Akka Persistence
On Tue, Jul 1, 2014 at 6:05 PM, Patrik Nordwall patrik@gmail.com javascript: wrote: Let's continue with questions at akka-user. /Patrik Good idea... The groups interface confuses me once in a while. On Tue, Jul 1, 2014 at 5:53 PM, Olger Warnier ol...@spectare.nl javascript: wrote: Nice, thanks :) A small question, the EventsourcedProcessor will be replaced by the PersistentProcessor (as my compile messages tell me :) ) It seems that it's not available in the 2.3.4 source, is that right ? The documentation states the use of the PersistentActor instead of the PersistentProcessor. With my assumption that this is not in 2.3.4 and will be created, what will be the difference ? That is a typo in the deprecation message. It is supposed to be PersistentActor. It is the replacement for both Processor and EventsourcedProcessor. Good to know, I'll move to the actor then. Next to that, I am using the EventsourcedProcessor with ClusterSharding and use the default processorId. Found a nice mention on how to get persistenceId work in the same way, but maybe there is a way to have the created PersistenceProcessor/Actor make use of a constructor that sets the proper ID (and not to be dependent on the actorPath) Any hints where this is done ? (and if it's possible to manipulate it ?) (My structure is similar as the akka cluster sharding activator template. I would recommend: // self.path.parent.name is the type name (utf-8 URL-encoded) // self.path.name is the entry identifier (utf-8 URL-encoded) override def persistenceId: String = self.path.parent.name + - + self.path.name Any reason you like to see the parent name inside the Id ? (I'll play around with it, but wondering if you have a specific reason for doing so) Regards, Patrik Thanks for your reply, Olger -- 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: Akka 2.3.4 Released - Major updates to Akka Persistence
On Tue, Jul 1, 2014 at 6:18 PM, Olger Warnier ol...@spectare.nl wrote: On Tue, Jul 1, 2014 at 6:05 PM, Patrik Nordwall patrik@gmail.com wrote: Let's continue with questions at akka-user. /Patrik Good idea... The groups interface confuses me once in a while. On Tue, Jul 1, 2014 at 5:53 PM, Olger Warnier ol...@spectare.nl wrote: Nice, thanks :) A small question, the EventsourcedProcessor will be replaced by the PersistentProcessor (as my compile messages tell me :) ) It seems that it's not available in the 2.3.4 source, is that right ? The documentation states the use of the PersistentActor instead of the PersistentProcessor. With my assumption that this is not in 2.3.4 and will be created, what will be the difference ? That is a typo in the deprecation message. It is supposed to be PersistentActor. It is the replacement for both Processor and EventsourcedProcessor. Good to know, I'll move to the actor then. Next to that, I am using the EventsourcedProcessor with ClusterSharding and use the default processorId. Found a nice mention on how to get persistenceId work in the same way, but maybe there is a way to have the created PersistenceProcessor/Actor make use of a constructor that sets the proper ID (and not to be dependent on the actorPath) Any hints where this is done ? (and if it's possible to manipulate it ?) (My structure is similar as the akka cluster sharding activator template. I would recommend: // self.path.parent.name is the type name (utf-8 URL-encoded) // self.path.name is the entry identifier (utf-8 URL-encoded) override def persistenceId: String = self.path.parent.name + - + self.path.name Any reason you like to see the parent name inside the Id ? (I'll play around with it, but wondering if you have a specific reason for doing so) To make it unique across different types. E.g. BlogPost(12) must not clash with User(12). If your ids are are already unique among all PersistentActor instances in your system you can use the plain id. /Patrik Regards, Patrik Thanks for your reply, Olger -- 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: Akka Cluster seed node problem
Hi Patrik, I can see all those messages now. It is working :). Thanks for all your help. Regards, Rohit -- 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: Akka Cluster seed node problem
Thanks for the update. Glad to hear that you got it working. /Patrik 1 jul 2014 kl. 18:32 skrev Rohit Kumar Gupta rohitkumargupt...@gmail.com: Hi Patrik, I can see all those messages now. It is working :). Thanks for all your help. Regards, Rohit -- 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. -- 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 Java future onComplete and onFailure syntax . Not compiling using doc example.
Thank you.It works. For whatever my editor could not complete and include the missing classes such as import akka.dispatch.OnComplete; Claude On Tuesday, July 1, 2014 8:10:14 AM UTC-4, √ wrote: Did you import it properly? API docs are here: http://doc.akka.io/japi/akka/2.3.4/?_ga=1.248190663.1579561034.1353497989 On Tue, Jul 1, 2014 at 2:00 PM, claude hussenet chus...@gmail.com javascript: wrote: Have no problem to implement the onSuccess method based on the doc ,but getting compilation issue for the onComplete and onFailure. // THE FOLLOWING COMPILE AND WORKS final FutureActorRef ft = remoteActor.resolveOne(timeout); ExecutionContext ec = system.dispatcher(); ft.onSuccess(new OnSuccessActorRef() { public void onSuccess(ActorRef remoteActor) throws Exception { // DO SOME WORK HERE } }, ec); //THE FOLLOWING TOOK DOES NOT COMPILE ..GETTING ERROR OnComplete can not be resolved to a type ft.onComplete(new OnComplete ActorRef () { public void onComplete(Throwable failure, ActorRef remoteRef) { if (failure != null) { //We got a failure, handle it here } else { // We got a result, do something with it } } }, ec); -- 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.com javascript:. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Cheers, √ -- 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 Java future onComplete and onFailure syntax . Not compiling using doc example.
Excellent, happy hAkking! On Jul 1, 2014 6:53 PM, claude hussenet chusse...@gmail.com wrote: Thank you.It works. For whatever my editor could not complete and include the missing classes such as import akka.dispatch.OnComplete; Claude On Tuesday, July 1, 2014 8:10:14 AM UTC-4, √ wrote: Did you import it properly? API docs are here: http://doc.akka.io/japi/akka/2.3.4/?_ga=1.248190663. 1579561034.1353497989 On Tue, Jul 1, 2014 at 2:00 PM, claude hussenet chus...@gmail.com wrote: Have no problem to implement the onSuccess method based on the doc ,but getting compilation issue for the onComplete and onFailure. // THE FOLLOWING COMPILE AND WORKS final FutureActorRef ft = remoteActor.resolveOne(timeout); ExecutionContext ec = system.dispatcher(); ft.onSuccess(new OnSuccessActorRef() { public void onSuccess(ActorRef remoteActor) throws Exception { // DO SOME WORK HERE } }, ec); //THE FOLLOWING TOOK DOES NOT COMPILE ..GETTING ERROR OnComplete can not be resolved to a type ft.onComplete(new OnComplete ActorRef () { public void onComplete(Throwable failure, ActorRef remoteRef) { if (failure != null) { //We got a failure, handle it here } else { // We got a result, do something with it } } }, ec); -- 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. -- Cheers, √ -- 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. -- 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] Akka cluster: node identity crisis
I have a cluster of 15 nodes/boxes. I start the nodes roughly at the same time. One of the nodes is behaving oddly and continually logging Ignoring received gossip intended for someone else. However, the node does seem to work for a while before being being dropped from the cluster. Basically this one node seems to think it is someone else, whilst also behaviouring as itself. The code and config is exactly the same on all 15 nodes so I don't understand why I'm getting this issue on only one node. Maybe this is a hardware issue? Some logging: 11:27:45.412 INFO [main] Remoting - Starting remoting 11:27:45.638 INFO [main] Remoting - Remoting started; listening on addresses :[akka.tcp://streaming@172.17.102.128:7000] 11:27:45.660 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Starting up... 11:27:45.714 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Registered cluster JMX MBean [akka:type=Cluster] 11:27:45.715 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Started up successfully 11:27:45.830 INFO [streaming-akka.actor.default-dispatcher-3] a.a.LocalActorRef - Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp://streaming@172.17.100.98:7000/system/cluster/core/daemon#1997515880] to Actor[akka://streaming/system/cluster/core/daemon/joinSeedNodeProcess-1#1132911] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'. 11:27:45.872 INFO [streaming-akka.actor.default-dispatcher-5] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Welcome from [akka.tcp://streaming@172.17.102.125:7000] 11:27:45.911 INFO [streaming-akka.actor.default-dispatcher-2] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.68:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] 11:27:45.943 INFO [streaming-akka.actor.default-dispatcher-16] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.70:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] 11:27:46.122 INFO [streaming-akka.actor.default-dispatcher-16] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.69:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] Config: akka { cluster { seed-nodes = [ akka.tcp://streaming@172.17.102.125:7000 akka.tcp://streaming@172.17.100.98:7000 ] } remote.netty.tcp.hostname = 172.17.102.128 } I thought it was weird that the unique address in the gossip messages referred to a negative number. I added log.info(smy unique ID: ${AddressUidExtension(actorSystem).addressUid}) to the confused node (I hope this is the correct code) and it gave me the answer 1549799231, whilst continuing to give -1482656725 in the gossip messages. I'm guessing the problem is that the gossip messages have a corrupted address, which is why the confused node believes these messages are not for itself. I'm using Akka 2.3.2. -- 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] Ensuring Cancellable jobs stop
Hello, I have a job that's scheduled with Scheduler and I save the Cancellable. The job isn't important, but it just sends a message to an Actor. After scheduling, it runs for a while and at some point I call cancel() on the Cancellable and need to ensure the job is actually done and won't fire again before continuing. What I'm finding is that cancel() on the Cancellable returns immediately and even looping/pausing on isCancelled doesn't ensure the job won't fire a few more times before finally stopping. (It runs once a second for my test purposes.) Is there a way I can ensure my cancelled job is completely done, never to fire again, before proceeding? (Nothing special, but code that schedules the job below): scheduledServices.put( svc.serviceId, server.system.scheduler.schedule( 5 seconds, 5 seconds, myActor, ExecuteTest(svc) ) ) Thanks, Greg -- 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 cluster: node identity crisis
Please use latest version, i.e. 2.3.4 There you find Cluster(system).selfUniqueAddress that includes the uid. I will look into this in more detail tomorrow. /Patrik 1 jul 2014 kl. 19:57 skrev Benjamin Black benblac...@gmail.com: I have a cluster of 15 nodes/boxes. I start the nodes roughly at the same time. One of the nodes is behaving oddly and continually logging Ignoring received gossip intended for someone else. However, the node does seem to work for a while before being being dropped from the cluster. Basically this one node seems to think it is someone else, whilst also behaviouring as itself. The code and config is exactly the same on all 15 nodes so I don't understand why I'm getting this issue on only one node. Maybe this is a hardware issue? Some logging: 11:27:45.412 INFO [main] Remoting - Starting remoting 11:27:45.638 INFO [main] Remoting - Remoting started; listening on addresses :[akka.tcp://streaming@172.17.102.128:7000] 11:27:45.660 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Starting up... 11:27:45.714 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Registered cluster JMX MBean [akka:type=Cluster] 11:27:45.715 INFO [main] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Started up successfully 11:27:45.830 INFO [streaming-akka.actor.default-dispatcher-3] a.a.LocalActorRef - Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp://streaming@172.17.100.98:7000/system/cluster/core/daemon#1997515880] to Actor[akka://streaming/system/cluster/core/daemon/joinSeedNodeProcess-1#1132911] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'. 11:27:45.872 INFO [streaming-akka.actor.default-dispatcher-5] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Welcome from [akka.tcp://streaming@172.17.102.125:7000] 11:27:45.911 INFO [streaming-akka.actor.default-dispatcher-2] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.68:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] 11:27:45.943 INFO [streaming-akka.actor.default-dispatcher-16] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.70:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] 11:27:46.122 INFO [streaming-akka.actor.default-dispatcher-16] Cluster(akka://streaming) - Cluster Node [akka.tcp://streaming@172.17.102.128:7000] - Ignoring received gossip intended for someone else, from [akka.tcp://streaming@172.17.102.69:7000] to [UniqueAddress(akka.tcp://streaming@172.17.102.128:7000,-1482656725)] Config: akka { cluster { seed-nodes = [ akka.tcp://streaming@172.17.102.125:7000 akka.tcp://streaming@172.17.100.98:7000 ] } remote.netty.tcp.hostname = 172.17.102.128 } I thought it was weird that the unique address in the gossip messages referred to a negative number. I added log.info(smy unique ID: ${AddressUidExtension(actorSystem).addressUid}) to the confused node (I hope this is the correct code) and it gave me the answer 1549799231, whilst continuing to give -1482656725 in the gossip messages. I'm guessing the problem is that the gossip messages have a corrupted address, which is why the confused node believes these messages are not for itself. I'm using Akka 2.3.2. -- 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. -- 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] Re: Akka 2.3.4 Released - Major updates to Akka Persistence
One small note for people that may run into this issue: Our project uses the leveldb in a shared mode 'native = off' in our multi-jvm test setup. (inmem in our inproc setup) It appears that the leveldb dependency gives issues in this setup. The whole thing is described here https://github.com/akka/akka/issues/15129 by excluding the leveldb 0.5 in your dependency setup (on akka-persistence) and added 0.7 manually, this is solved. like: val akkaPersistence = com.typesafe.akka %% akka-persistence-experimental % V.akka exclude(org.iq80.leveldb,leveldb) val levelDbFixed = org.iq80.leveldb% leveldb % 0.7 (thereafter use these in your build definition) Interesting thing here is that it was updated before: https://github.com/akka/akka/blob/33030ca96930d0a76a8906f4028b43bec747a555/project/AkkaBuild.scala#L1119 (but the releasing branches refer to 0.5 it appears (after a bit of browsing) -- 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] Work push/pull vs ?
I've had some success using the worker pull pattern to process time series data in a particular channel. A channel job actor builds the queue of time chunks for a work pull master and workers work on chunks of time. Now I wish to process multiple (possibly millions of) channels in parallel and am wondering whether to a) repeat the pattern, treating a page of channels as the work queue item, where the page workers would spawn a channel job per channel, or b) use something else like routers or balancing dispatcher. Any tips? -- 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.