On Fri, Aug 14, 2015 at 9:37 AM, Bas Beelen <bjgbee...@gmail.com> wrote:

> Hi guys,
>
> In my project I was using Akka 2.4-M1 using a ClusterSingleton, which
> worked as expected. Code example:
>
>
>
> object Shoppers { def apply(excludedProductsActor: ActorRef, system:
> ActorSystem): ActorRef = { val nodeRole = Some(Settings(system).nodeRole)
> val singletonManager = system.actorOf( ClusterSingletonManager.props(
> singletonProps = ShoppersActor.props(excludedProductsActor),
> terminationMessage = PoisonPill, ClusterSingletonManagerSettings
> (system).withSingletonName(ShoppersActor.name).withRole(nodeRole) ), name
> = "shoppers-singleton" ) system.actorOf( ClusterSingletonProxy.props(
> singletonPath = singletonManager.path.child(ShoppersActor
> .name).toStringWithoutAddress, ClusterSingletonProxySettings
> (system).withRole(nodeRole)
>

Try to change this
to 
ClusterSingletonProxySettings(system).withSingletonName(ShoppersActor.name).withRole(nodeRole)

Normally you don't care about the singleton instance name, and can skip
withSingletonName here and also in the ClusterSingletonManagerSettings.

/Patrik



> ), name = "shoppers-proxy" ) }}
>
> Yesterday I tried to upgrade to Akka 2.4-M2.
> I fixed a compile error since singletonPath has become
> singletonManagerPath and I also changed its value to refer to its path
> (instead of the singleton's actor path, as described in the 2.4-M2
> ClusterSingleton docs).
> Looks like this:
>
>
> object Shoppers { def apply(excludedProductsActor: ActorRef, system:
> ActorSystem): ActorRef = { val nodeRole = Some(Settings(system).nodeRole)
> val singletonManager = system.actorOf( ClusterSingletonManager.props(
> singletonProps = ShoppersActor.props(excludedProductsActor),
> terminationMessage = PoisonPill, ClusterSingletonManagerSettings
> (system).withSingletonName(ShoppersActor.name).withRole(nodeRole) ), name
> = "shoppers-singleton" ) system.actorOf( ClusterSingletonProxy.props(
> singletonManagerPath = singletonManager.path.toStringWithoutAddress, //
> which resolves to /user/shoppers-singleton ClusterSingletonProxySettings
> (system).withRole(nodeRole) ), name = "shoppers-proxy" ) }}
>
>
> However, now I get ask timeouts. It seems none of the messages that are
> sent to the singletonProxy are received. I also tried it with a simple
> "ping" / "pong" example, with no luck.
>
> Did I make a mistake? Is the documentation for ClusterSingleton in Akka
> 2.4-M2 not correct? Is there a bug? Something else?
>
> Thanks in advance for any help!
>
> best regards,
> Bas Beelen
>
>
>
>
> --
> >>>>>>>>>> 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.

Reply via email to