Different entry actors under a ShardRegion

144 views
Skip to first unread message

Yifei

unread,
Jul 30, 2015, 12:10:40 PM7/30/15
to Akka User List
The use case is that I have production version and development version of an actor
I want to route some traffic of this shardregion to dev actors

Can I spawn different entry actors(pod and dev) according to the shardId/actorId under a shardregion?

Thanks

Justin du coeur

unread,
Jul 30, 2015, 12:58:55 PM7/30/15
to akka...@googlegroups.com
Patrik is the expert, but looking at the API and code as it currently stands, I doubt it.  To make this possible seems like it would require some restructuring of Cluster Sharding so that you could pass in a "PropsExtractor", corresponding to the Shard and Id Extractors, which would return different Props depending on the message.  Not rocket science, but it's a fairly esoteric requirement, so I don't know how high a priority it would be.

If you really need it, I suspect you could fork Cluster Sharding to make it happen, and suggest a possible PR...

--
>>>>>>>>>> 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.

Yifei

unread,
Jul 30, 2015, 3:28:05 PM7/30/15
to Akka User List, jduc...@gmail.com
Thanks Justin,

If Akka doesn't support different actors under a shard region, Can I overwrite ShardCoordinator and define the routing logic in the coordinator?

For example, perhaps I can launch two ShardRegions such as SR and SR_DEV, the coordinator of SR redirects the message id ended with 0 to 20 to SR_DEV

Thanks

Patrik Nordwall

unread,
Jul 30, 2015, 3:54:17 PM7/30/15
to akka...@googlegroups.com
Perhaps use an intermediate actor as the entity actor and it can route messages to child prod/dev actors?

Or use an intermediate actor in front of two different shard region actors and it can route the messages to the appropriate prod/dev shard region?

/Patrik
--
/Patrik
Reply all
Reply to author
Forward
0 new messages