none
Retry logic for WCF service RRS feed

  • Question

  • Hi All,

    I have a WCF service and an operation contract which will return an Object.

    This WCF service will be utilised by an external system,

    While returning the object from WCF service, the WCF service has to try 10 times if any communication failure happens.

    Could you please suggest a better way handle this scenario.

    Thanks in advance

    Thursday, December 1, 2016 7:11 PM

All replies

  • Hi Divya,

    Do you mean you want to retry the response from WCF to client? If so, I think you could try cache results on server for some (limited) time. You can provide unique id for each request, then on server check if request with such id was completed already and if yes - deliver the results immediatly. Otherwise, process response and cache it for limited time, in case client will retry a bit later. On client - just retry on failure.

    I suggest you refer the link below for more information.

    # How to receive a response from server in WCF reliable messaging after connection cuts

    http://stackoverflow.com/questions/40301178/how-to-receive-a-response-from-server-in-wcf-reliable-messaging-after-connection

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Tony---- Tuesday, December 6, 2016 6:14 AM
    Friday, December 2, 2016 5:20 AM
  • Hi Edward,

    Thanks for the update. 

    Could you please share some sample code that would help me better.

    Thanks in advance

    Monday, December 5, 2016 12:45 PM
  • Hi Divya,

    I am afraid there is no such sample code. I would suggest you try to implement it, and if you have any problem, please feel free to post in this forum.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Tony---- Tuesday, December 6, 2016 6:14 AM
    • Unproposed as answer by Tony---- Tuesday, December 6, 2016 6:14 AM
    Tuesday, December 6, 2016 6:13 AM