locked
Configuration Options for the Dss Runtime. Enabling timeout tracking on all Dssp operations. Part 2/3 RRS feed

  • General discussion

  • This is the second post in a series of posts that explain Dss Runtime configuration. Once again, I will focus on how to configure the Dss runtime, using the configuration file associated with the host executable that starts a Dss node. In the most common case, this is DssHost.Exe. If you use the static DssEnvironment class, you can use any managed executable to start the DssRuntime, and by modifying your executable's configuration file, you can achieve the same results.

     

    Dss enables a very useful feature to find services that dont respond to requests, causing deadlock, or lack of progress, in your application: You can tell the runtime to track timeouts for every outbound request to any other service, local or remote. In the dsshost.exe.config file, modify the line highlighted:

     


    Code Snippet
        <appSettings>
            ....
            <!-- DsspTimeoutTracking enables/disables expiration on all DsspOperations,
    -->

            <add key="Microsoft.Dss.Services.Forwarders.DsspTimeoutTracking" value="true"/>
              
            ....
        </appSettings>

     

    By setting the value to "true", all outbound requests that dont complete within the interval specifed in the static field DsspOperation.DefaultShortTimeout (30 seconds), will be completed with a Soap.Fault response. This allows your service to at least deal with the failure and make progress. The Fault.Code.Subcode field will contain a Timeout value, allowing you to distinguish this fault from any other failure. This setting is strongly recommended when debugging your orchestration application.

     

    Also note that you can set a specific timeout on your outbound requests explicitly. In the example below we set the DsspOperatiom.TimeSpan field before posting the outbound request:

     

    using cons = Microsoft.Dss.Services.Constructor;

    ....

     

        // create a service using its contract identifier

        cons.Create create = new cons.Create(

            new ServiceInfoType(Contract.Identifier)

        );
         create.TimeSpan = TimeSpan.FromSeconds(40);

        yield return Arbiter.Choice(
             create.ResponsePort,
             delegate(CreateResponse createResponse) { },
             delegate(Fault fault)
             {
                if (d.Code.Subcode.Value == dssp.DsspFaultCodes.ResponseTimeout)

               {
                    LogError("Time out received");
                }                           

            }

        );

     

     

    Tuesday, April 17, 2007 5:29 AM