Example #1
0
        public string DurableOrchestrationClientToString(DurableOrchestrationClient client, OrchestrationClientAttribute attr)
        {
            var payload = new OrchestrationClientInputData
            {
                TaskHubName    = client.TaskHubName,
                CreationUrls   = this.config.HttpApiHandler.GetInstanceCreationLinks(),
                ManagementUrls = this.config.HttpApiHandler.CreateHttpManagementPayload(InstanceIdPlaceholder, attr?.TaskHub, attr?.ConnectionName),
            };

            return(JsonConvert.SerializeObject(payload));
        }
        public string DurableOrchestrationClientToString(IDurableOrchestrationClient client, DurableClientAttribute attr)
        {
            var payload = new OrchestrationClientInputData
            {
                TaskHubName    = client.TaskHubName,
                CreationUrls   = this.config.HttpApiHandler.GetInstanceCreationLinks(),
                ManagementUrls = this.config.HttpApiHandler.CreateHttpManagementPayload(InstanceIdPlaceholder, attr?.TaskHub, attr?.ConnectionName),
                BaseUrl        = this.config.HttpApiHandler.GetBaseUrl(),
                RequiredQueryStringParameters = this.config.HttpApiHandler.GetUniversalQueryStrings(),
            };

            if (this.config.HttpApiHandler.TryGetRpcBaseUrl(out Uri rpcBaseUrl))
            {
                // If an RPC URL is not available, the out-of-proc durable client SDK is expected to fail.
                // In the case of JavaScript, however, the client SDK is expected to revert to legacy behavior.
                payload.RpcBaseUrl = rpcBaseUrl.OriginalString;
            }

            return(JsonConvert.SerializeObject(payload));
        }