Re: [akka-user] Cluster Sharding custom routing

2016-12-13 Thread Akka Team
Hi Luis,

Sharding allows for a custom ShardAllocationStrategy, which has two
purposes: allocating new shards and taking decisions about rebalancing.
Maybe this could cover what you want to do. (See API here:
http://doc.akka.io/api/akka/2.4/#akka.cluster.sharding.ShardCoordinator$$ShardAllocationStrategy
)

--
Johan Andrén
Akka Team

On Tue, Dec 6, 2016 at 7:13 PM, Luis Pedrosa  wrote:

> Hello!
>
>
> From what I understand, the cluster sharder GracefulShutdown
> implementation, removes the node from the cluster. It also signals all the
> remaining nodes to buffer any messages that target shards already allocated
> on the given node.
>
>
> I believe this is because the use case assumes that you will migrate the
> entities accordingly before the node is removed from the cluster.
>
>
> I have a different use case in mind. I would like to signal the sharder
> that a node shouldn't be considered for any new allocation. However, It
> should still be able to accept any message for pre-allocated shards.
>
>
> The reason is that my entities are not ready for persistence (something I
> would like to address at a later stage). Given that, migrating them is not
> a desirable option.
>
>
> I was wondering, is there a way to make this use case work with the
> cluster sharder mechanics?
>
> Should I consider implementing a simple clustered routing solution that
> satisfies our use case?
>
> Or is there another solution provided by the akka-cluster extensions that
> I should be looking at?
>
>
> In conclusion, on the ClusterSharder, a new shard is allocated to a node
> that is currently up. I would like to control this allocation, for a given
> node:
>
>- By still being able to accept messages for shards that are already
>allocated in the node
>- By not allowing any new shards to be allocated in the node
>
> Thank you in advance!
>
> --
> >> 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 https://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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Cluster Sharding custom routing

2016-12-06 Thread Luis Pedrosa


Hello!


>From what I understand, the cluster sharder GracefulShutdown 
implementation, removes the node from the cluster. It also signals all the 
remaining nodes to buffer any messages that target shards already allocated 
on the given node.


I believe this is because the use case assumes that you will migrate the 
entities accordingly before the node is removed from the cluster.


I have a different use case in mind. I would like to signal the sharder 
that a node shouldn't be considered for any new allocation. However, It 
should still be able to accept any message for pre-allocated shards.


The reason is that my entities are not ready for persistence (something I 
would like to address at a later stage). Given that, migrating them is not 
a desirable option.


I was wondering, is there a way to make this use case work with the cluster 
sharder mechanics?

Should I consider implementing a simple clustered routing solution that 
satisfies our use case?

Or is there another solution provided by the akka-cluster extensions that I 
should be looking at?


In conclusion, on the ClusterSharder, a new shard is allocated to a node 
that is currently up. I would like to control this allocation, for a given 
node:

   - By still being able to accept messages for shards that are already 
   allocated in the node
   - By not allowing any new shards to be allocated in the node

Thank you in advance!

-- 
>>  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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.