Hi, Some of the methods in ClusterContext are not thread safe I guess(i.e getCurrentPartitionIndex). This can be a problem in some operations like autoscaling.
In auto scaling algorithms (ex : round robin)we use getPartitionCount() to check the whether a given partition is non empty (max number of instance limit is not met in this partition). In a case where multiple subscriptions happens concurrently, the thread unsafetiness may cause problem since auto scaler decides to span insances more that max allowed. I think it is better to think about concurrency issues we may face in the future which will be hard to solve in future. Appreciate your suggestions. -- Udara Liyanage Software Engineer WSO2, Inc.: http://wso2.com lean. enterprise. middleware web: http://udaraliyanage.wordpress.com phone: +94 71 443 6897
