tags:

views:

135

answers:

1

The code below only prints one instance id per instance even though I'm running 4 instances. Is this a bug in development fabric or this is how it is supposed to be?

public override void Run()
{
    foreach (RoleInstance roleInst in RoleEnvironment.CurrentRoleInstance.Role.Instances)
    {
        Trace.WriteLine("Instance ID: " + roleInst.Id);
    }
}
+1  A: 

You need to have at least one internal endpoint for all the role instances to show up.

smarx
Why is that necessary?
Hasan Khan
No good reason, as far as I know. In some sense it makes sense (what would the point be of discovering the other instances if you had no way to interact with them?), but I have a feeling we'll change this in the future. I'll ping our developer platform team.
smarx
Thanks smarx. One possible use case is that instances communicate with each other using a queue or table or some other hosted medium.
Hasan Khan