Re: [akka-user] Cluster Sharding and Roles

2015-05-07 Thread Chanan Braunstein
Hi Patrik,

I tried this with some limited success. Sent messages to the command nodes 
(which I only had one up) and they seemed to work and go there and not 
query - I only tried a manual test of a few commands, so it is not a true 
test.

However, when I tried an ask to the query roles, I got no response and it 
did not appear that the Actor on the query role even got the message. I 
didn't look into it too much since I have an issue with ask anyway on the 
other thread. So I will try again once I get that resolved.

On Tuesday, May 5, 2015 at 7:48:04 AM UTC-4, Patrik Nordwall wrote:



 On Tue, May 5, 2015 at 12:41 PM, Chanan Braunstein 
 chanan.b...@pearson.com javascript: wrote:

 Hi Patrik,

 No I haven't tried that approach yet. Will ClusterSharding know which 
 nodes have the Persistent actors on them and which the views. I assumed 
 that I need to tell ClusterSharding which nodes have what. But, I can try 
 it and see how goes.


 I thought you used different typeName for those different things. 
 Otherwise you will have a problem in the backend anyway.
  


 On a similar matter, any chance you can tell me why my replies are 
 disappearing from the backend? 
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 On Tuesday, May 5, 2015 at 4:24:18 AM UTC-4, Patrik Nordwall wrote:



 On Mon, May 4, 2015 at 1:01 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Sorry, I didn't explain it correctly. I have 3 roles not two.

 Frontend

 Command (Backend insert of data with Persistent Actors)
 Query (Backend query with views)


 I guessed so.
  


 So, for now, sounds like my strategy of having three ActorSystems on 
 the front end (Application, Command, Query) is the way to go till 2.4 
 comes 
 out when I will change it to use the roles in the ShardRegion itself.


 Have you tried to use one ActorSystem in the Frontend and configure it 
 with
 akka.contrib.cluster.sharding.role=DOES_NOT_EXIST
 ?

 I think that should just solve it, unless have done a mistake in my 
 thinking of how this works.

 /Patrik
  


 Now if I can only figure out why my replies from the query cluster are 
 disappearing... 
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 Chanan.

 On Monday, May 4, 2015 at 3:03:06 AM UTC-4, Patrik Nordwall wrote:



 On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the 
 config option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


 It is reading the role from 
 configuration akka.contrib.cluster.sharding.role.
 It is possible to have different values of this on different nodes, 
 e.g. use Command on some backend nodes and Query on some other nodes.
 The limitation is that you cannot have a node with several nodes, i.e. 
 hosting shards for different roles.
  


 What I did for now till 2.4 comes out, please let me know if this is 
 not a good idea, is create two ActorSystems on the front end, one for 
 each 
 role, so when I want to use a an actor from the Command role, I create 
 the ShardingRegion on that ActorSystem, and same for the Query role. 
 Does 
 that make sense for now?


 That is a creative workaround, but I don't understand why that would 
 be needed. In the frontend nodes you can 
 configure akka.contrib.cluster.sharding.role to something else than 
 FrontEnd (e.g. Command) and then those will start in proxy mode since the 
 node does not satisfy the configured akka.contrib.cluster.sharding.role.

 /Patrik
  


 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall 
 wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only 
 solves half the problem. The other issue is that I need to have the 
 actor 
 class on the local machine to get a ClusterShard. What I would like 
 to do 
 is to implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however 
 I would still need the source code of the the two cluster to be on the 
 frontend because IU need the actor class on the front end. Really it 
 is not 
 need there it is only used by the two back end cluster, I hesitate to 
 say 
 this, but it might be better to give the class name as a string... Not 
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention 
 that the entryProps is optional, i.e. you can have sharding regions on 
 front end nodes that only act as proxies. Also, there is some limited 
 support for roles in cluster sharding in 2.3.x.

 /Patrik
  


 Chanan


 On Wednesday, April 

Re: [akka-user] Cluster Sharding and Roles

2015-05-05 Thread Patrik Nordwall
On Tue, May 5, 2015 at 12:41 PM, Chanan Braunstein 
chanan.braunst...@pearson.com wrote:

 Hi Patrik,

 No I haven't tried that approach yet. Will ClusterSharding know which
 nodes have the Persistent actors on them and which the views. I assumed
 that I need to tell ClusterSharding which nodes have what. But, I can try
 it and see how goes.


I thought you used different typeName for those different things. Otherwise
you will have a problem in the backend anyway.



 On a similar matter, any chance you can tell me why my replies are
 disappearing from the backend?
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 On Tuesday, May 5, 2015 at 4:24:18 AM UTC-4, Patrik Nordwall wrote:



 On Mon, May 4, 2015 at 1:01 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Sorry, I didn't explain it correctly. I have 3 roles not two.

 Frontend

 Command (Backend insert of data with Persistent Actors)
 Query (Backend query with views)


 I guessed so.



 So, for now, sounds like my strategy of having three ActorSystems on the
 front end (Application, Command, Query) is the way to go till 2.4 comes out
 when I will change it to use the roles in the ShardRegion itself.


 Have you tried to use one ActorSystem in the Frontend and configure it
 with
 akka.contrib.cluster.sharding.role=DOES_NOT_EXIST
 ?

 I think that should just solve it, unless have done a mistake in my
 thinking of how this works.

 /Patrik



 Now if I can only figure out why my replies from the query cluster are
 disappearing...
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 Chanan.

 On Monday, May 4, 2015 at 3:03:06 AM UTC-4, Patrik Nordwall wrote:



 On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the
 config option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


 It is reading the role from
 configuration akka.contrib.cluster.sharding.role.
 It is possible to have different values of this on different nodes,
 e.g. use Command on some backend nodes and Query on some other nodes.
 The limitation is that you cannot have a node with several nodes, i.e.
 hosting shards for different roles.



 What I did for now till 2.4 comes out, please let me know if this is
 not a good idea, is create two ActorSystems on the front end, one for each
 role, so when I want to use a an actor from the Command role, I create
 the ShardingRegion on that ActorSystem, and same for the Query role. 
 Does
 that make sense for now?


 That is a creative workaround, but I don't understand why that would be
 needed. In the frontend nodes you can
 configure akka.contrib.cluster.sharding.role to something else than
 FrontEnd (e.g. Command) and then those will start in proxy mode since the
 node does not satisfy the configured akka.contrib.cluster.sharding.role.

 /Patrik



 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall
 wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only
 solves half the problem. The other issue is that I need to have the 
 actor
 class on the local machine to get a ClusterShard. What I would like 
 to do
 is to implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I
 would still need the source code of the the two cluster to be on the
 frontend because IU need the actor class on the front end. Really it is 
 not
 need there it is only used by the two back end cluster, I hesitate to 
 say
 this, but it might be better to give the class name as a string... Not
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that
 the entryProps is optional, i.e. you can have sharding regions on front 
 end
 nodes that only act as proxies. Also, there is some limited support for
 roles in cluster sharding in 2.3.x.

 /Patrik



 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon
 start working on to get over through the finish-line - no hard 
 timeline for
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our
 customers - in general new features are not added to maintanance 
 relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a
 ClusterShard to be on in the cluster. There is a pull request that was
 merged in Oct 2014 that adds roles to 

Re: [akka-user] Cluster Sharding and Roles

2015-05-05 Thread Patrik Nordwall
On Mon, May 4, 2015 at 1:01 PM, Chanan Braunstein 
chanan.braunst...@pearson.com wrote:

 Sorry, I didn't explain it correctly. I have 3 roles not two.

 Frontend

 Command (Backend insert of data with Persistent Actors)
 Query (Backend query with views)


I guessed so.



 So, for now, sounds like my strategy of having three ActorSystems on the
 front end (Application, Command, Query) is the way to go till 2.4 comes out
 when I will change it to use the roles in the ShardRegion itself.


Have you tried to use one ActorSystem in the Frontend and configure it with
akka.contrib.cluster.sharding.role=DOES_NOT_EXIST
?

I think that should just solve it, unless have done a mistake in my
thinking of how this works.

/Patrik



 Now if I can only figure out why my replies from the query cluster are
 disappearing...
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 Chanan.

 On Monday, May 4, 2015 at 3:03:06 AM UTC-4, Patrik Nordwall wrote:



 On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the
 config option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


 It is reading the role from
 configuration akka.contrib.cluster.sharding.role.
 It is possible to have different values of this on different nodes, e.g.
 use Command on some backend nodes and Query on some other nodes.
 The limitation is that you cannot have a node with several nodes, i.e.
 hosting shards for different roles.



 What I did for now till 2.4 comes out, please let me know if this is not
 a good idea, is create two ActorSystems on the front end, one for each
 role, so when I want to use a an actor from the Command role, I create
 the ShardingRegion on that ActorSystem, and same for the Query role. Does
 that make sense for now?


 That is a creative workaround, but I don't understand why that would be
 needed. In the frontend nodes you can
 configure akka.contrib.cluster.sharding.role to something else than
 FrontEnd (e.g. Command) and then those will start in proxy mode since the
 node does not satisfy the configured akka.contrib.cluster.sharding.role.

 /Patrik



 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only
 solves half the problem. The other issue is that I need to have the actor
 class on the local machine to get a ClusterShard. What I would like to 
 do
 is to implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I
 would still need the source code of the the two cluster to be on the
 frontend because IU need the actor class on the front end. Really it is 
 not
 need there it is only used by the two back end cluster, I hesitate to say
 this, but it might be better to give the class name as a string... Not
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that
 the entryProps is optional, i.e. you can have sharding regions on front end
 nodes that only act as proxies. Also, there is some limited support for
 roles in cluster sharding in 2.3.x.

 /Patrik



 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon
 start working on to get over through the finish-line - no hard timeline 
 for
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers
 - in general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a
 ClusterShard to be on in the cluster. There is a pull request that was
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a
 date for that?

 Thanks,
 Chanan

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

Re: [akka-user] Cluster Sharding and Roles

2015-05-05 Thread Chanan Braunstein
Hi Patrik,

No I haven't tried that approach yet. Will ClusterSharding know which nodes 
have the Persistent actors on them and which the views. I assumed that I 
need to tell ClusterSharding which nodes have what. But, I can try it and 
see how goes.

On a similar matter, any chance you can tell me why my replies are 
disappearing from the 
backend? https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

On Tuesday, May 5, 2015 at 4:24:18 AM UTC-4, Patrik Nordwall wrote:



 On Mon, May 4, 2015 at 1:01 PM, Chanan Braunstein chanan.b...@pearson.com 
 javascript: wrote:

 Sorry, I didn't explain it correctly. I have 3 roles not two.

 Frontend

 Command (Backend insert of data with Persistent Actors)
 Query (Backend query with views)


 I guessed so.
  


 So, for now, sounds like my strategy of having three ActorSystems on the 
 front end (Application, Command, Query) is the way to go till 2.4 comes out 
 when I will change it to use the roles in the ShardRegion itself.


 Have you tried to use one ActorSystem in the Frontend and configure it with
 akka.contrib.cluster.sharding.role=DOES_NOT_EXIST
 ?

 I think that should just solve it, unless have done a mistake in my 
 thinking of how this works.

 /Patrik
  


 Now if I can only figure out why my replies from the query cluster are 
 disappearing... 
 https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

 Chanan.

 On Monday, May 4, 2015 at 3:03:06 AM UTC-4, Patrik Nordwall wrote:



 On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the 
 config option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


 It is reading the role from 
 configuration akka.contrib.cluster.sharding.role.
 It is possible to have different values of this on different nodes, e.g. 
 use Command on some backend nodes and Query on some other nodes.
 The limitation is that you cannot have a node with several nodes, i.e. 
 hosting shards for different roles.
  


 What I did for now till 2.4 comes out, please let me know if this is 
 not a good idea, is create two ActorSystems on the front end, one for each 
 role, so when I want to use a an actor from the Command role, I create 
 the ShardingRegion on that ActorSystem, and same for the Query role. 
 Does 
 that make sense for now?


 That is a creative workaround, but I don't understand why that would be 
 needed. In the frontend nodes you can 
 configure akka.contrib.cluster.sharding.role to something else than 
 FrontEnd (e.g. Command) and then those will start in proxy mode since the 
 node does not satisfy the configured akka.contrib.cluster.sharding.role.

 /Patrik
  


 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall 
 wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only 
 solves half the problem. The other issue is that I need to have the 
 actor 
 class on the local machine to get a ClusterShard. What I would like to 
 do 
 is to implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I 
 would still need the source code of the the two cluster to be on the 
 frontend because IU need the actor class on the front end. Really it is 
 not 
 need there it is only used by the two back end cluster, I hesitate to 
 say 
 this, but it might be better to give the class name as a string... Not 
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that 
 the entryProps is optional, i.e. you can have sharding regions on front 
 end 
 nodes that only act as proxies. Also, there is some limited support for 
 roles in cluster sharding in 2.3.x.

 /Patrik
  


 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon 
 start working on to get over through the finish-line - no hard timeline 
 for 
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers 
 - in general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a 
 ClusterShard to be on in the cluster. There is a pull request that was 
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a 
 date for that?

 Thanks,
 Chanan

 -- 
  Read the 

Re: [akka-user] Cluster Sharding and Roles

2015-05-04 Thread Patrik Nordwall
On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein 
chanan.braunst...@pearson.com wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the config
 option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


It is reading the role from
configuration akka.contrib.cluster.sharding.role.
It is possible to have different values of this on different nodes, e.g.
use Command on some backend nodes and Query on some other nodes.
The limitation is that you cannot have a node with several nodes, i.e.
hosting shards for different roles.



 What I did for now till 2.4 comes out, please let me know if this is not a
 good idea, is create two ActorSystems on the front end, one for each role,
 so when I want to use a an actor from the Command role, I create the
 ShardingRegion on that ActorSystem, and same for the Query role. Does
 that make sense for now?


That is a creative workaround, but I don't understand why that would be
needed. In the frontend nodes you can
configure akka.contrib.cluster.sharding.role to something else than
FrontEnd (e.g. Command) and then those will start in proxy mode since the
node does not satisfy the configured akka.contrib.cluster.sharding.role.

/Patrik



 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only solves
 half the problem. The other issue is that I need to have the actor class on
 the local machine to get a ClusterShard. What I would like to do is to
 implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I
 would still need the source code of the the two cluster to be on the
 frontend because IU need the actor class on the front end. Really it is not
 need there it is only used by the two back end cluster, I hesitate to say
 this, but it might be better to give the class name as a string... Not
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that
 the entryProps is optional, i.e. you can have sharding regions on front end
 nodes that only act as proxies. Also, there is some limited support for
 roles in cluster sharding in 2.3.x.

 /Patrik



 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon
 start working on to get over through the finish-line - no hard timeline for
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers -
 in general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a
 ClusterShard to be on in the cluster. There is a pull request that was
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date
 for that?

 Thanks,
 Chanan

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




 --
 Akka Team
 Typesafe - Reactive apps on the JVM
 Blog: letitcrash.com
 Twitter: @akkateam

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives:
 https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google
 Groups Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --

 Patrik Nordwall
 Typesafe http://typesafe.com/ -  Reactive apps on the JVM
 Twitter: @patriknw

   --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: 

Re: [akka-user] Cluster Sharding and Roles

2015-05-04 Thread Chanan Braunstein
Sorry, I didn't explain it correctly. I have 3 roles not two.

Frontend

Command (Backend insert of data with Persistent Actors)
Query (Backend query with views)

So, for now, sounds like my strategy of having three ActorSystems on the 
front end (Application, Command, Query) is the way to go till 2.4 comes out 
when I will change it to use the roles in the ShardRegion itself.

Now if I can only figure out why my replies from the query cluster are 
disappearing... https://groups.google.com/forum/#!topic/akka-user/iXWVGlEWo50

Chanan.

On Monday, May 4, 2015 at 3:03:06 AM UTC-4, Patrik Nordwall wrote:



 On Fri, May 1, 2015 at 1:19 PM, Chanan Braunstein chanan.b...@pearson.com 
 javascript: wrote:

 Hi Patrik,

 What/where is the limited support for roles in 2.3, do you mean the 
 config option: akka.contrib.cluster.sharding.role ?

 If so, that would only work for one role type, right?


 It is reading the role from 
 configuration akka.contrib.cluster.sharding.role.
 It is possible to have different values of this on different nodes, e.g. 
 use Command on some backend nodes and Query on some other nodes.
 The limitation is that you cannot have a node with several nodes, i.e. 
 hosting shards for different roles.
  


 What I did for now till 2.4 comes out, please let me know if this is not 
 a good idea, is create two ActorSystems on the front end, one for each 
 role, so when I want to use a an actor from the Command role, I create 
 the ShardingRegion on that ActorSystem, and same for the Query role. Does 
 that make sense for now?


 That is a creative workaround, but I don't understand why that would be 
 needed. In the frontend nodes you can 
 configure akka.contrib.cluster.sharding.role to something else than 
 FrontEnd (e.g. Command) and then those will start in proxy mode since the 
 node does not satisfy the configured akka.contrib.cluster.sharding.role.

 /Patrik
  


 On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only 
 solves half the problem. The other issue is that I need to have the actor 
 class on the local machine to get a ClusterShard. What I would like to 
 do 
 is to implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I 
 would still need the source code of the the two cluster to be on the 
 frontend because IU need the actor class on the front end. Really it is 
 not 
 need there it is only used by the two back end cluster, I hesitate to say 
 this, but it might be better to give the class name as a string... Not 
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that 
 the entryProps is optional, i.e. you can have sharding regions on front end 
 nodes that only act as proxies. Also, there is some limited support for 
 roles in cluster sharding in 2.3.x.

 /Patrik
  


 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon 
 start working on to get over through the finish-line - no hard timeline 
 for 
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers - 
 in general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a 
 ClusterShard to be on in the cluster. There is a pull request that was 
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date 
 for that?

 Thanks,
 Chanan

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




 -- 
 Akka Team
 Typesafe - Reactive apps on the JVM
 Blog: letitcrash.com
 Twitter: @akkateam
  
  -- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: 
 

Re: [akka-user] Cluster Sharding and Roles

2015-05-01 Thread Chanan Braunstein
Hi Patrik,

What/where is the limited support for roles in 2.3, do you mean the config 
option: akka.contrib.cluster.sharding.role ?

If so, that would only work for one role type, right?

What I did for now till 2.4 comes out, please let me know if this is not a 
good idea, is create two ActorSystems on the front end, one for each role, 
so when I want to use a an actor from the Command role, I create the 
ShardingRegion on that ActorSystem, and same for the Query role. Does 
that make sense for now?

On Wednesday, April 29, 2015 at 11:34:23 AM UTC-4, Patrik Nordwall wrote:



 On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
 chanan.b...@pearson.com javascript: wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only solves 
 half the problem. The other issue is that I need to have the actor class on 
 the local machine to get a ClusterShard. What I would like to do is to 
 implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I 
 would still need the source code of the the two cluster to be on the 
 frontend because IU need the actor class on the front end. Really it is not 
 need there it is only used by the two back end cluster, I hesitate to say 
 this, but it might be better to give the class name as a string... Not 
 ideal either, but it will decouple the back end from the front end.


 I'm not sure I understand the problem, but would like to mention that 
 the entryProps is optional, i.e. you can have sharding regions on front end 
 nodes that only act as proxies. Also, there is some limited support for 
 roles in cluster sharding in 2.3.x.

 /Patrik
  


 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon 
 start working on to get over through the finish-line - no hard timeline for 
 it but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers - 
 in general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a 
 ClusterShard to be on in the cluster. There is a pull request that was 
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date 
 for that?

 Thanks,
 Chanan

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




 -- 
 Akka Team
 Typesafe - Reactive apps on the JVM
 Blog: letitcrash.com
 Twitter: @akkateam
  
  -- 
  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.




 -- 

 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] Cluster Sharding and Roles

2015-04-29 Thread Akka Team
Hello there,
This new feature will be part of the 2.4.x release which we'll soon start
working on to get over through the finish-line - no hard timeline for it
but soon :-)
If you need it back-ported to 2.3.x we can do this for our customers - in
general new features are not added to maintanance relases.

-- Konrad

On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
chanan.braunst...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a
 ClusterShard to be on in the cluster. There is a pull request that was
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date for
 that?

 Thanks,
 Chanan

 --
  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 Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster Sharding and Roles

2015-04-29 Thread Chanan Braunstein
Thanks Konrad, I will wait till 2.4.

However, thinking about this a bit more adding cluster roles only solves 
half the problem. The other issue is that I need to have the actor class on 
the local machine to get a ClusterShard. What I would like to do is to 
implement CQRS/ES like this:

Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

Akka cluster with Persistent actor - Cluster Role: Command

Akka cluster with Persistent views - Cluster Role: Query

Once cluster roles are in place, this will let me do this, however I would 
still need the source code of the the two cluster to be on the frontend 
because IU need the actor class on the front end. Really it is not need 
there it is only used by the two back end cluster, I hesitate to say this, 
but it might be better to give the class name as a string... Not ideal 
either, but it will decouple the back end from the front end.

Chanan


On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon start 
 working on to get over through the finish-line - no hard timeline for it 
 but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers - in 
 general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com javascript: wrote:

 Hello,

 It looks like this is currently no way to specify a role for a 
 ClusterShard to be on in the cluster. There is a pull request that was 
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date for 
 that?

 Thanks,
 Chanan

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




 -- 
 Akka Team
 Typesafe - Reactive apps on the JVM
 Blog: letitcrash.com
 Twitter: @akkateam
  

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster Sharding and Roles

2015-04-29 Thread Patrik Nordwall
On Wed, Apr 29, 2015 at 3:08 PM, Chanan Braunstein 
chanan.braunst...@pearson.com wrote:

 Thanks Konrad, I will wait till 2.4.

 However, thinking about this a bit more adding cluster roles only solves
 half the problem. The other issue is that I need to have the actor class on
 the local machine to get a ClusterShard. What I would like to do is to
 implement CQRS/ES like this:

 Play servers (fronted by HAProxy) - Cluster Role: FrontEnd

 Akka cluster with Persistent actor - Cluster Role: Command

 Akka cluster with Persistent views - Cluster Role: Query

 Once cluster roles are in place, this will let me do this, however I would
 still need the source code of the the two cluster to be on the frontend
 because IU need the actor class on the front end. Really it is not need
 there it is only used by the two back end cluster, I hesitate to say this,
 but it might be better to give the class name as a string... Not ideal
 either, but it will decouple the back end from the front end.


I'm not sure I understand the problem, but would like to mention that
the entryProps is optional, i.e. you can have sharding regions on front end
nodes that only act as proxies. Also, there is some limited support for
roles in cluster sharding in 2.3.x.

/Patrik



 Chanan


 On Wednesday, April 29, 2015 at 5:33:41 AM UTC-4, Akka Team wrote:

 Hello there,
 This new feature will be part of the 2.4.x release which we'll soon start
 working on to get over through the finish-line - no hard timeline for it
 but soon :-)
 If you need it back-ported to 2.3.x we can do this for our customers - in
 general new features are not added to maintanance relases.

 -- Konrad

 On Tue, Apr 28, 2015 at 6:33 PM, Chanan Braunstein 
 chanan.b...@pearson.com wrote:

 Hello,

 It looks like this is currently no way to specify a role for a
 ClusterShard to be on in the cluster. There is a pull request that was
 merged in Oct 2014 that adds roles to ClusterShards:

 https://github.com/akka/akka/issues/16123

 Will that be in the point release of Akka, and if so, is there a date
 for that?

 Thanks,
 Chanan

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




 --
 Akka Team
 Typesafe - Reactive apps on the JVM
 Blog: letitcrash.com
 Twitter: @akkateam

  --
  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] Cluster Sharding and Roles

2015-04-28 Thread Chanan Braunstein
Hello,

It looks like this is currently no way to specify a role for a ClusterShard 
to be on in the cluster. There is a pull request that was merged in Oct 
2014 that adds roles to ClusterShards:

https://github.com/akka/akka/issues/16123

Will that be in the point release of Akka, and if so, is there a date for 
that?

Thanks,
Chanan

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster, sharding and roles

2014-06-02 Thread Patrik Nordwall
Hi Eduardo,

The ClusterSharding extension supports configuration of one role to use a
subset of nodes, but that is not what you are looking for. Instead of using
the ClusterSharding extension you may start the actors yourself and thereby
specify the roles.
See:
ShardCoordinatorSupervisor.props
ShardCoordinator.props
ShardRegion.props

Note that the ShardCoordinatorSupervisor is supposed be started with
a ClusterSingletonManager. See here:
https://github.com/akka/akka/blob/v2.3.3/akka-contrib/src/main/scala/akka/contrib/pattern/ClusterSharding.scala#L360

Cheers,
Patrik



On Fri, May 30, 2014 at 1:20 PM, Eduardo Fernandes edu...@gmail.com wrote:

 Hi all.

 Probably this is a silly question but I couldn't find any clear answer in
 the group or docs.

 Suppose I have a cluster with 4 nodes with 2 roles (2 node instances per
 role). How could I create two shardings, each one sending messages to the
 nodes belonging to a particular role? The idea is add a new node with a
 particular role and let the cluster sharding distribute the work among all
 nodes belonging to that role. I suppose I could create two sharding
 regions, one per role, and assign the sharding to a role in some way?

 I'm using Java and Akka 2.3.3.

 Many thanks for your help.

 Eduardo.


  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+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

http://typesafe.com/go-reactive-activator-contest

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster, sharding and roles

2014-06-02 Thread Eduardo Fernandes
Many Thanks Patrik.

I'm afraid that if I manage the actors directly I'll lose all the cluster 
benefits, include spreading out the mapping objectId - physical node. I 
think that I can reduce the problem to a case where I could avoid the 
creation of new actors in a particular node in the cluster and then, after 
all actors are virtually inactive, turn the node down. 

I don't know where is the mapping of entryId - physical node. 

Could I override the distribution logical somehow so I could control in 
which physical node the actor will be instantiated in the cluster? That 
would be perfect. I'd overridden the mapping using the sharding policy with 
  AbstractShardAllocationStrategy inheriting 
from LeastShardAllocationStrategy but I couldn't find where adjust the way 
the cluster assign physical nodes to the particular sharding entry.

Many thanks, Patrik, for your help.

Regards.



El lunes, 2 de junio de 2014 10:24:34 UTC+2, Patrik Nordwall escribió:

 Hi Eduardo,

 The ClusterSharding extension supports configuration of one role to use a 
 subset of nodes, but that is not what you are looking for. Instead of using 
 the ClusterSharding extension you may start the actors yourself and thereby 
 specify the roles.
 See:
 ShardCoordinatorSupervisor.props
 ShardCoordinator.props
 ShardRegion.props

 Note that the ShardCoordinatorSupervisor is supposed be started with 
 a ClusterSingletonManager. See here: 
 https://github.com/akka/akka/blob/v2.3.3/akka-contrib/src/main/scala/akka/contrib/pattern/ClusterSharding.scala#L360

 Cheers,
 Patrik


 

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster, sharding and roles

2014-06-02 Thread Patrik Nordwall
On Mon, Jun 2, 2014 at 1:10 PM, Eduardo Fernandes edu...@gmail.com wrote:

 Many Thanks Patrik.

 I'm afraid that if I manage the actors directly I'll lose all the cluster
 benefits, include spreading out the mapping objectId - physical node.


That would not change. The ClusterSharding extension is only creating
exactly the same actors for you, in a convenient way. I understand that you
think it is overwhelming to create these actors yourself, but it is
possible (and the reason why the props methods are public).


 I think that I can reduce the problem to a case where I could avoid the
 creation of new actors in a particular node in the cluster and then, after
 all actors are virtually inactive, turn the node down.

 I don't know where is the mapping of entryId - physical node.

 Could I override the distribution logical somehow so I could control in
 which physical node the actor will be instantiated in the cluster? That
 would be perfect. I'd overridden the mapping using the sharding policy with
   AbstractShardAllocationStrategy inheriting
 from LeastShardAllocationStrategy but I couldn't find where adjust the way
 the cluster assign physical nodes to the particular sharding entry.


Yes, that is done by the information returned by the
AbstractShardAllocationStrategy. The passed in currentShardAllocations
contains the ActorRefs of the ShardRegion actors, and you could use the
addresses of these to decide which nodes to use. You must somehow correlate
those addresses with the addresses of the cluster members if you want to
use the cluster role information.

The AbstractShardAllocationStrategy does not allocate locations for
individual entries. That is always done on a group of entries, a.k.a.
shard. You define the mapping between entry ids (messages) and shards in
the MessageExtractor.

/Patrik



 Many thanks, Patrik, for your help.

 Regards.



 El lunes, 2 de junio de 2014 10:24:34 UTC+2, Patrik Nordwall escribió:

 Hi Eduardo,

 The ClusterSharding extension supports configuration of one role to use a
 subset of nodes, but that is not what you are looking for. Instead of using
 the ClusterSharding extension you may start the actors yourself and thereby
 specify the roles.
 See:
 ShardCoordinatorSupervisor.props
 ShardCoordinator.props
 ShardRegion.props

 Note that the ShardCoordinatorSupervisor is supposed be started with
 a ClusterSingletonManager. See here: https://github.com/akka/
 akka/blob/v2.3.3/akka-contrib/src/main/scala/akka/contrib/
 pattern/ClusterSharding.scala#L360

 Cheers,
 Patrik


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

http://typesafe.com/go-reactive-activator-contest

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Cluster, sharding and roles

2014-06-02 Thread Eduardo Fernandes
Many Thanks Patrik for your time!

I'll check the addresses and let you know. With this info I could,
theoretically, implements a smooth node shutdown.

Best regards!


On Mon, Jun 2, 2014 at 3:12 PM, Patrik Nordwall patrik.nordw...@gmail.com
wrote:




 On Mon, Jun 2, 2014 at 1:10 PM, Eduardo Fernandes edu...@gmail.com
 wrote:

 Many Thanks Patrik.

 I'm afraid that if I manage the actors directly I'll lose all the cluster
 benefits, include spreading out the mapping objectId - physical node.


 That would not change. The ClusterSharding extension is only creating
 exactly the same actors for you, in a convenient way. I understand that you
 think it is overwhelming to create these actors yourself, but it is
 possible (and the reason why the props methods are public).


 I think that I can reduce the problem to a case where I could avoid the
 creation of new actors in a particular node in the cluster and then, after
 all actors are virtually inactive, turn the node down.

 I don't know where is the mapping of entryId - physical node.

 Could I override the distribution logical somehow so I could control in
 which physical node the actor will be instantiated in the cluster? That
 would be perfect. I'd overridden the mapping using the sharding policy with
   AbstractShardAllocationStrategy inheriting
 from LeastShardAllocationStrategy but I couldn't find where adjust the way
 the cluster assign physical nodes to the particular sharding entry.


 Yes, that is done by the information returned by the
 AbstractShardAllocationStrategy. The passed in currentShardAllocations
 contains the ActorRefs of the ShardRegion actors, and you could use the
 addresses of these to decide which nodes to use. You must somehow correlate
 those addresses with the addresses of the cluster members if you want to
 use the cluster role information.

 The AbstractShardAllocationStrategy does not allocate locations for
 individual entries. That is always done on a group of entries, a.k.a.
 shard. You define the mapping between entry ids (messages) and shards in
 the MessageExtractor.

 /Patrik



 Many thanks, Patrik, for your help.

 Regards.



 El lunes, 2 de junio de 2014 10:24:34 UTC+2, Patrik Nordwall escribió:

 Hi Eduardo,

 The ClusterSharding extension supports configuration of one role to use
 a subset of nodes, but that is not what you are looking for. Instead of
 using the ClusterSharding extension you may start the actors yourself and
 thereby specify the roles.
 See:
 ShardCoordinatorSupervisor.props
 ShardCoordinator.props
 ShardRegion.props

 Note that the ShardCoordinatorSupervisor is supposed be started with
 a ClusterSingletonManager. See here: https://github.com/akka/
 akka/blob/v2.3.3/akka-contrib/src/main/scala/akka/contrib/
 pattern/ClusterSharding.scala#L360

 Cheers,
 Patrik


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

 http://typesafe.com/go-reactive-activator-contest

  --
  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 a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/iP-w0OqBbHg/unsubscribe.
 To unsubscribe from this group and all its topics, 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] Cluster, sharding and roles

2014-06-02 Thread Eduardo Fernandes
It worked perfectly!

Many thanks for your help!

Regards.



El lunes, 2 de junio de 2014 15:24:58 UTC+2, Eduardo Fernandes escribió:

 Many Thanks Patrik for your time!

 I'll check the addresses and let you know. With this info I could, 
 theoretically, implements a smooth node shutdown. 

 Best regards!



-- 
  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] Cluster, sharding and roles

2014-05-30 Thread Eduardo Fernandes
Hi all.

Probably this is a silly question but I couldn't find any clear answer in 
the group or docs.

Suppose I have a cluster with 4 nodes with 2 roles (2 node instances per 
role). How could I create two shardings, each one sending messages to the 
nodes belonging to a particular role? The idea is add a new node with a 
particular role and let the cluster sharding distribute the work among all 
nodes belonging to that role. I suppose I could create two sharding 
regions, one per role, and assign the sharding to a role in some way?

I'm using Java and Akka 2.3.3.

Many thanks for your help.

Eduardo.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+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.