Why I can not acquire the endpoint information of other role running in the same hosted service from a role?

Answered Why I can not acquire the endpoint information of other role running in the same hosted service from a role?

  • Wednesday, December 01, 2010 5:02 AM
     
     

    Hi all,

    I want to retrieve the endpoint information of other role running in the same hosted service from a instance of different role. How can I do that?

    It seems that When I use :
                           var  endpoints = RoleEnvironment.Roles["RoleName"].Instances
                                      .Select(i => i.InstanceEndpoints["RoleName"]).ToArray();

    it give me an empty array. I found that .Instances has already return 0 element.

    Do anybody know the issue is normal, or it is the problem of my code?

     

    Yours sincerely,

    Jessie

     

All Replies

  • Wednesday, December 01, 2010 5:44 AM
     
     

    BTW,

    The endpoint I want to get is a Input Endpoint.

    I know from that

    http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/35007aac-3cd1-4207-8952-a6878cf72d3e

    the reason that why I get 0 instances returned. But even when I can the instance I want, I still can not get the Input Endpoint.

     

    Jessie

     

     

  • Wednesday, December 01, 2010 5:44 AM
    Answerer
     
     Answered

    The following is documented:

    A role must define at least one internal endpoint in order for its set of instances to be known at runtime.

    This means that unless a role defines an internal endpoint you will not be able to enumerate its instances from another role. Consequently, the observed behavior is correct.

     

    • Marked As Answer by Jessie Wei Wednesday, December 01, 2010 6:39 AM
    •  
  • Wednesday, December 01, 2010 6:45 AM
     
     

    Hi Neil,

    Thank you. I have tried your suggestion.

    When I add the internal endpoint to the role, I did enumerate the instances of the role.

    But from other role, I still can not find the external input endpoint from the enumeration and it seem that I can only get the information of the internal endpoint I defines.

    My question is do you know whether Windows Azure supports a role can comunicate other role by using the ipendpoint of input endpoint?

    Thank you.

     

    Jessie

      

  • Wednesday, December 01, 2010 7:18 AM
    Answerer
     
     

    My question is do you know whether Windows Azure supports a role can comunicate other role by using the ipendpoint of input endpoint?

    I believe the only way to access the input endpoint of another role is to come in through the load balancer just like an external service or user.