none
Web Role and Worker Role Synchronous Communication via WCF service

    Question

  • Hi All, I am trying to achieve Web Role and Worker Role Synchronous Communication via WCF service. I have a couple of questions : 1) Are in internal endpoints ment for communication between instances of the same Role. 2) I tried using a internal end pt exposed by Worker role inside a Web role by grabbing Endpoint URL as : RoleEnvironment.Roles["WcfWorkerRole"].Instances, but the Instances list has zero entries which suggest that i dont have any worker role instances running. How can this be possible as i can see an Wroker instance running inside emulator UI. Can anyone suggest a different way of getting EP URL. Thanks.
    Monday, February 21, 2011 6:38 AM

Answers

  • Also, make sure that you actually have an internal endpoint declared when you try to enumerate the instances. If there are no internal endpoints declared for a role, the instances won't show up in that enumeration.
    Monday, February 21, 2011 8:12 AM
  • Hello Vinayak,

    1) Internal Endpoints are intended to be used to communicate instances from any role of the same service.

    2) The collection RoleEnvironment.Roles["WcfWorkerRole"].Instances.Count should return the deployed "WcfWorkerRole" role instances number of that role, double check that there is a role on the .csdef file with this name and the trace operation. I think there is no other way to know that number.

    Regards,

    Alfredo

    Monday, February 21, 2011 7:13 AM

All replies

  • Hello Vinayak,

    1) Internal Endpoints are intended to be used to communicate instances from any role of the same service.

    2) The collection RoleEnvironment.Roles["WcfWorkerRole"].Instances.Count should return the deployed "WcfWorkerRole" role instances number of that role, double check that there is a role on the .csdef file with this name and the trace operation. I think there is no other way to know that number.

    Regards,

    Alfredo

    Monday, February 21, 2011 7:13 AM
  • Also, make sure that you actually have an internal endpoint declared when you try to enumerate the instances. If there are no internal endpoints declared for a role, the instances won't show up in that enumeration.
    Monday, February 21, 2011 8:12 AM
  • Thanks Alfredo and Steve for your responses. I'll try the suggestions.

    Also  I wanted to know whether external endpoints publicly discoverable and do they have any cost bearing?

    If not, I am more inclined towards using load balanced external endpoints against internal one's which are not load balanced. If you can point out any drawbacks of using external EPs against internal one's in will be really helpful.

     

    Thanks.

    Monday, February 21, 2011 12:35 PM
  • Hello Vinayak,

    You can discover the external endpoints using the same RoleEnvironment collection.

    One advantage of internal endpoints is that its security is guaranteed by the platform, they are located in the service VLAN and can't be accessed by any other service in the datacenter or from internet. In code means that SecurityMode.None can be selected when setting up the binding.

    Regards,

    Alfredo

     

    Monday, February 21, 2011 1:49 PM
  • Hurray!! I got the internal EP working. Therefore marking your responses as answers.

    Also I had one concern as to how do i implement load balancing effectively between the three instances of worker role i plan to spin?

    Any pointer here would be gr8.

    Thanks a lot for the prompt response Alfredo!!

    Regards,

    Vinayak.

     

    Monday, February 21, 2011 1:59 PM
  • With internal endpoints, is it possible to have a man-in-the-middle attack?  Should I encrypt all messages (WCF service)?  
    Saturday, July 14, 2012 3:31 AM