Reputation: 5445
I need to find the current partition key of a Service Fabric Stateful Service at run time.
I have looked in the ICodePackageActivationContext
and the StatefulServiceContext
but can't seem to see this information anywhere.
Edit:
As LoekD pointed out in his answer this information is available from within the StatefulService
class. Just to be explicitly clear, here is how I accessed:
var info = (Int64RangePartitionInformation) this.Partition.PartitionInfo;
var highKey = info.HighKey;
var lowKey = info.LowKey;
Upvotes: 2
Views: 191