none
How to set client priority while consuming WCF service RRS feed

  • Question

  • A very Good Mrng Sir/Madam,

    Could anybody please help me. I have a big issue.

    My question is , suppose more than one client (say: client1, client2, client3...) are trying to consume a service.

    But I want to give highest priority to client1 so that when ever request will be made Simultaneously , always client1's request will be handled first .

    Could anybody please suggest me with code or any clue?

    Thanks a lot in advance.

    With Regards

    Bubun


    bbpitha

    Thursday, October 3, 2013 4:56 AM

Answers

  • There are ways to do this, but they involve forcing delays in handling requests or rejecting specific requests; neither of these approaches are typically recommended.  A WCF web service is capable of constantly receiving requests and responding to each one; unless you have extremely long-running web methods (which will cause their own problems), you should not need to worry about blocking or queuing specific requests.  You can reject requests from lower-priority clients if there is a higher-priority client request in progress, but again, this would really degrade the quality of service for the lower-priority clients.  In any event, the lower-priority client applications would have to be programmed in such a way to expect these delays and/or request rejections, which will mean that they will probably need more logic in the implementation and a whole lot more testing.

    If you are intent on doing some kind of content-based request handling and you are using .NET version 4 or greater, you can refer to this MSDN page:

    http://msdn.microsoft.com/en-us/library/ee517423(v=vs.100).aspx


    If my response was helpful, please vote it as helpful. If I have answered the question being asked, please mark my post as the answer.

    • Marked as answer by sibasissinha Friday, October 4, 2013 8:19 AM
    Thursday, October 3, 2013 1:53 PM

All replies

  • I don't think there is anything that you can implement concerning setting client priority.
    Thursday, October 3, 2013 5:54 AM
  • There are ways to do this, but they involve forcing delays in handling requests or rejecting specific requests; neither of these approaches are typically recommended.  A WCF web service is capable of constantly receiving requests and responding to each one; unless you have extremely long-running web methods (which will cause their own problems), you should not need to worry about blocking or queuing specific requests.  You can reject requests from lower-priority clients if there is a higher-priority client request in progress, but again, this would really degrade the quality of service for the lower-priority clients.  In any event, the lower-priority client applications would have to be programmed in such a way to expect these delays and/or request rejections, which will mean that they will probably need more logic in the implementation and a whole lot more testing.

    If you are intent on doing some kind of content-based request handling and you are using .NET version 4 or greater, you can refer to this MSDN page:

    http://msdn.microsoft.com/en-us/library/ee517423(v=vs.100).aspx


    If my response was helpful, please vote it as helpful. If I have answered the question being asked, please mark my post as the answer.

    • Marked as answer by sibasissinha Friday, October 4, 2013 8:19 AM
    Thursday, October 3, 2013 1:53 PM
  • Hi Bubun,

    >>My question is , suppose more than one client (say: client1, client2, client3...) are trying to consume a service.

    According to my understanding, if these clients are independent, there is no priority between those clients, their requests will not impact each other, so I would agree with darnold said above.

    Can you elaborate your question more clearly if you mean something different?

    Thanks.

    Best Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, October 4, 2013 2:31 AM
    Moderator
  • Hi Gaixia,

    Thanks a lot for reply.

    All of three viewers has provided same answer. Now it's ok with me.

    Thanks again.

    Sibasis


    bbpitha

    Friday, October 4, 2013 8:20 AM
  • Thanks alot  more_Wagon for such a nice answer.

    Thanks again

    Sibasis


    bbpitha

    Friday, October 4, 2013 8:22 AM
  • Thanks Darnold for your reply.

    Thanks Sibasis


    bbpitha

    Friday, October 4, 2013 8:23 AM