how to use cluster client and cluster sharding together

343 views
Skip to first unread message

Xingrun CHEN

unread,
Mar 6, 2014, 6:09:58 AM3/6/14
to akka...@googlegroups.com
To use cluster client, I must register service on server nodes as receptionist .

But in the sharding cluster, shard region actor will not register it self as a receptionist. So in order to access sharding entities through cluster client, I need to register some 'proxy' actors as receptionist in the cluster and forward msg to region actor.

is there better way?

Patrik Nordwall

unread,
Mar 6, 2014, 12:03:40 PM3/6/14
to akka...@googlegroups.com
Hi,


On Thu, Mar 6, 2014 at 12:09 PM, Xingrun CHEN <cowb...@gmail.com> wrote:
To use cluster client, I must register service on server nodes as receptionist .

But in the sharding cluster, shard region actor will not register it self as a receptionist. So in order to access sharding entities through cluster client, I need to register some 'proxy' actors as receptionist in the cluster and forward msg to region actor.

You can register the shard region actor as receptionist.

ClusterSharding(system).start("NAME", ...)
ClusterReceptionistExtension(system).registerService(
  ClusterSharding(system).shardRegion("NAME"))

The path will be "/user/sharding/NAME"

/Patrik
 

is there better way?

--
>>>>>>>>>> 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/groups/opt_out.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Xingrun CHEN

unread,
Mar 6, 2014, 10:42:13 PM3/6/14
to akka...@googlegroups.com
Thanks, Patrik. It works well!

Patrik Nordwall

unread,
Mar 7, 2014, 2:22:05 AM3/7/14
to akka...@googlegroups.com
On Fri, Mar 7, 2014 at 4:42 AM, Xingrun CHEN <cowb...@gmail.com> wrote:
Thanks, Patrik. It works well!

Glad to hear that. By the way, in this scenario you should always use localAffinity=true in the ClusterClient.Send messages.

/Patrik
 
For more options, visit https://groups.google.com/d/optout.

Denis Mikhaylov

unread,
Jun 24, 2016, 1:40:15 AM6/24/16
to Akka User List
UPDATE: It's /system/sharding/NAME now

четверг, 6 марта 2014 г., 21:03:40 UTC+4 пользователь Patrik Nordwall написал:
Reply all
Reply to author
Forward
0 new messages