From 6665e383e66a296439622917fb10100c50ea0f59 Mon Sep 17 00:00:00 2001 From: "davidrevoledo1@gmail.com" Date: Wed, 19 Aug 2020 20:16:09 -0300 Subject: [PATCH 1/5] merge dev into init durable client --- .../DurableClientFactory.cs | 39 +++++++ .../IDurableClientFactory.cs | 20 ++++ .../DurableClientAttribute.cs | 22 ++++ ...rableTaskJobHostConfigurationExtensions.cs | 26 +++++ ....WebJobs.Extensions.DurableTask-net461.xml | 95 ++++++++++++++++ ...t.Azure.WebJobs.Extensions.DurableTask.xml | 102 ++++++++++++++++++ .../Options/DurableClientOptions.cs | 37 +++++++ .../Options/DurableTaskOptions.cs | 3 +- .../StandardConnectionStringProvider.cs | 34 ++++++ 9 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs create mode 100644 src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs create mode 100644 src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs create mode 100644 src/WebJobs.Extensions.DurableTask/StandardConnectionStringProvider.cs diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs new file mode 100644 index 000000000..00fcd5303 --- /dev/null +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; + +namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations +{ + /// + /// Factory class to create Durable Client to start works outside an azure function context. + /// + public class DurableClientFactory : IDurableClientFactory + { + private readonly DurableTaskExtension durableTaskConfig; + + /// + /// Initializes a new instance of the class. + /// + /// Configuration for the Durable Functions extension. + public DurableClientFactory(DurableTaskExtension durableTaskConfig) + { + this.durableTaskConfig = durableTaskConfig; + } + + /// + /// Gets a using configuration from a instance. + /// + /// options containing the client configuration parameters. + /// Returns a instance. The returned instance may be a cached instance. + public IDurableClient CreateClient(DurableClientOptions durableClientOptions) + { + if (string.IsNullOrWhiteSpace(durableClientOptions.TaskHub)) + { + durableClientOptions.TaskHub = DurableTaskOptions.DefaultHubName; + } + + return this.durableTaskConfig.GetClient(new DurableClientAttribute(durableClientOptions)); + } + } +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs new file mode 100644 index 000000000..dfd22a218 --- /dev/null +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; + +namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations +{ + /// + /// Factory class to create Durable Client to start works outside an azure function context. + /// + public interface IDurableClientFactory + { + /// + /// Gets a using configuration from a instance. + /// + /// options containing the client configuration parameters. + /// Returns a instance. The returned instance may be a cached instance. + IDurableClient CreateClient(DurableClientOptions durableClientOptions); + } +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/DurableClientAttribute.cs b/src/WebJobs.Extensions.DurableTask/DurableClientAttribute.cs index faddbefb1..10984dafe 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableClientAttribute.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableClientAttribute.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; using Microsoft.Azure.WebJobs.Description; +using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { @@ -15,6 +16,22 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask [Binding] public class DurableClientAttribute : Attribute, IEquatable { + /// + /// Initializes a new instance of the class. + /// + public DurableClientAttribute() { } + + /// + /// Initializes a new instance of the class. + /// + /// durable client options + public DurableClientAttribute(DurableClientOptions durableClientOptions) + { + this.TaskHub = durableClientOptions.TaskHub; + this.ConnectionName = durableClientOptions.ConnectionName; + this.ExternalClient = durableClientOptions.IsExternalClient; + } + /// /// Optional. Gets or sets the name of the task hub in which the orchestration data lives. /// @@ -39,6 +56,11 @@ public class DurableClientAttribute : Attribute, IEquatable public string ConnectionName { get; set; } + /// + /// Indicate if the client is External from the azure function where orchestrator functions are hosted. + /// + public bool ExternalClient { get; set; } + /// /// Returns a hash code for this attribute. /// diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index 2f9113bfd..a1ecf41a7 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -5,6 +5,7 @@ using System.Net.Http; using System.Threading; #if !FUNCTIONS_V1 +using Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; @@ -43,10 +44,35 @@ public static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder) serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); return builder; } + /// + /// Adds the Durable Task extension to the provided . + /// + /// The to configure. + /// Returns the provided . + public static IServiceCollection AddDurableTask(this IServiceCollection serviceCollection) + { + if (serviceCollection == null) + { + throw new ArgumentNullException(nameof(serviceCollection)); + } + + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); + + return serviceCollection; + } + /// /// Adds the Durable Task extension to the provided . /// diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml index 2ed86704c..ef130a82c 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml @@ -156,6 +156,36 @@ + + + Factory class to create Durable Client to start works outside an azure function context. + + + + + Initializes a new instance of the class. + + Configuration for the Durable Functions extension. + + + + Gets a using configuration from a instance. + + options containing the client configuration parameters. + Returns a instance. The returned instance may be a cached instance. + + + + Factory class to create Durable Client to start works outside an azure function context. + + + + + Gets a using configuration from a instance. + + options containing the client configuration parameters. + Returns a instance. The returned instance may be a cached instance. + Common functionality used by both @@ -1691,6 +1721,17 @@ Attribute used to bind a function parameter to a , , or instance. + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + durable client options + Optional. Gets or sets the name of the task hub in which the orchestration data lives. @@ -1712,6 +1753,11 @@ If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. + + + Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Returns a hash code for this attribute. @@ -3119,6 +3165,37 @@ Throws an exception if any of the settings of the storage provider are invalid. + + + Options used to bind a function parameter to a , , or instance. + + + + + Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect + to instances of the storage provider other than the default one this application communicates with. + + The name of an app setting containing connection details. + + For Azure Storage the default behavior is to use the value of . + If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. + + + + + Optional. Gets or sets the name of the task hub in which the orchestration data lives. + + The task hub used by this binding. + + The default behavior is to use the task hub name specified in . + If no value exists there, then a default value will be used. + + + + + Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Configuration options for the Durable Task extension. @@ -3609,6 +3686,24 @@ The delegate to handle exception to determie if retries should proceed. + + + Connection string provider which resolves connection strings from the an standard application (Non WebJob). + + + + + Initializes a new instance of the class. + + A object provided by the application host. + + + + Looks up a connection string value given a name. + + The name of the connection string. + Returns the resolved connection string value. + Parameters for starting a new instance of an orchestration. diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml index 79ff1bc98..7342b1e37 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml @@ -156,6 +156,36 @@ + + + Factory class to create Durable Client to start works outside an azure function context. + + + + + Initializes a new instance of the class. + + Configuration for the Durable Functions extension. + + + + Gets a using configuration from a instance. + + options containing the client configuration parameters. + Returns a instance. The returned instance may be a cached instance. + + + + Factory class to create Durable Client to start works outside an azure function context. + + + + + Gets a using configuration from a instance. + + options containing the client configuration parameters. + Returns a instance. The returned instance may be a cached instance. + Common functionality used by both @@ -1696,6 +1726,17 @@ Attribute used to bind a function parameter to a , , or instance. + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + durable client options + Optional. Gets or sets the name of the task hub in which the orchestration data lives. @@ -1717,6 +1758,11 @@ If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. + + + Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Returns a hash code for this attribute. @@ -2059,6 +2105,13 @@ The to configure. Returns the provided . + + + Adds the Durable Task extension to the provided . + + The to configure. + Returns the provided . + Adds the Durable Task extension to the provided . @@ -3159,6 +3212,37 @@ Throws an exception if any of the settings of the storage provider are invalid. + + + Options used to bind a function parameter to a , , or instance. + + + + + Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect + to instances of the storage provider other than the default one this application communicates with. + + The name of an app setting containing connection details. + + For Azure Storage the default behavior is to use the value of . + If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. + + + + + Optional. Gets or sets the name of the task hub in which the orchestration data lives. + + The task hub used by this binding. + + The default behavior is to use the task hub name specified in . + If no value exists there, then a default value will be used. + + + + + Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Configuration options for the Durable Task extension. @@ -3649,6 +3733,24 @@ The delegate to handle exception to determie if retries should proceed. + + + Connection string provider which resolves connection strings from the an standard application (Non WebJob). + + + + + Initializes a new instance of the class. + + A object provided by the application host. + + + + Looks up a connection string value given a name. + + The name of the connection string. + Returns the resolved connection string value. + Parameters for starting a new instance of an orchestration. diff --git a/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs new file mode 100644 index 000000000..75b2febd8 --- /dev/null +++ b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Options +{ + /// + /// Options used to bind a function parameter to a , , or instance. + /// + public class DurableClientOptions + { + /// + /// Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect + /// to instances of the storage provider other than the default one this application communicates with. + /// + /// The name of an app setting containing connection details. + /// + /// For Azure Storage the default behavior is to use the value of . + /// If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. + /// + public string ConnectionName { get; set; } + + /// + /// Optional. Gets or sets the name of the task hub in which the orchestration data lives. + /// + /// The task hub used by this binding. + /// + /// The default behavior is to use the task hub name specified in . + /// If no value exists there, then a default value will be used. + /// + public string TaskHub { get; set; } + + /// + /// Indicate if the client is External from the azure function where orchestrator functions are hosted. + /// + public bool IsExternalClient { get; set; } + } +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/Options/DurableTaskOptions.cs b/src/WebJobs.Extensions.DurableTask/Options/DurableTaskOptions.cs index 26183836b..2a5712242 100644 --- a/src/WebJobs.Extensions.DurableTask/Options/DurableTaskOptions.cs +++ b/src/WebJobs.Extensions.DurableTask/Options/DurableTaskOptions.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// public class DurableTaskOptions { + internal const string DefaultHubName = "TestHubName"; private string originalHubName; private string resolvedHubName; private string defaultHubName; @@ -43,7 +44,7 @@ public string HubName { // "WEBSITE_SITE_NAME" is an environment variable used in Azure functions infrastructure. When running locally, this can be // specified in local.settings.json file to avoid being defaulted to "TestHubName" - this.resolvedHubName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "TestHubName"; + this.resolvedHubName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? DefaultHubName; this.defaultHubName = this.resolvedHubName; } diff --git a/src/WebJobs.Extensions.DurableTask/StandardConnectionStringProvider.cs b/src/WebJobs.Extensions.DurableTask/StandardConnectionStringProvider.cs new file mode 100644 index 000000000..d488004c2 --- /dev/null +++ b/src/WebJobs.Extensions.DurableTask/StandardConnectionStringProvider.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.Extensions.Configuration; + +namespace Microsoft.Azure.WebJobs.Extensions.DurableTask +{ + /// + /// Connection string provider which resolves connection strings from the an standard application (Non WebJob). + /// + public class StandardConnectionStringProvider : IConnectionStringResolver + { + private readonly IConfiguration configuration; + + /// + /// Initializes a new instance of the class. + /// + /// A object provided by the application host. + public StandardConnectionStringProvider(IConfiguration configuration) + { + this.configuration = configuration; + } + + /// + /// Looks up a connection string value given a name. + /// + /// The name of the connection string. + /// Returns the resolved connection string value. + public string Resolve(string connectionStringName) + { + return this.configuration[connectionStringName]; + } + } +} \ No newline at end of file From 1cc88001816adf1d3551eef839ce9849386c53eb Mon Sep 17 00:00:00 2001 From: David Revoledo Date: Thu, 9 Jan 2020 19:10:42 -0300 Subject: [PATCH 2/5] Changes for Init Durable CLient --- .../DurableClientFactory.cs | 15 ++++++++++++++- ...DurableTaskJobHostConfigurationExtensions.cs | 14 ++++++++++++++ ...re.WebJobs.Extensions.DurableTask-net461.xml | 9 ++++++++- ...oft.Azure.WebJobs.Extensions.DurableTask.xml | 17 ++++++++++++++++- .../Options/DurableClientOptions.cs | 5 ++++- 5 files changed, 56 insertions(+), 4 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs index 00fcd5303..5d41058e0 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; +using Microsoft.Extensions.Options; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations { @@ -11,14 +12,17 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations public class DurableClientFactory : IDurableClientFactory { private readonly DurableTaskExtension durableTaskConfig; + private readonly DurableClientOptions defaultDurableClientOptions; /// /// Initializes a new instance of the class. /// /// Configuration for the Durable Functions extension. - public DurableClientFactory(DurableTaskExtension durableTaskConfig) + /// Default Options to Build Durable Clients. + public DurableClientFactory(DurableTaskExtension durableTaskConfig, IOptions defaultDurableClientOptions) { this.durableTaskConfig = durableTaskConfig; + this.defaultDurableClientOptions = defaultDurableClientOptions.Value; } /// @@ -35,5 +39,14 @@ public IDurableClient CreateClient(DurableClientOptions durableClientOptions) return this.durableTaskConfig.GetClient(new DurableClientAttribute(durableClientOptions)); } + + /// + /// Gets a using configuration from a instance. + /// + /// Returns a instance. The returned instance may be a cached instance. + public IDurableClient CreateClient() + { + return this.CreateClient(this.defaultDurableClientOptions); + } } } \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index a1ecf41a7..6da76f960 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -6,6 +6,7 @@ using System.Threading; #if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations; +using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; @@ -73,6 +74,19 @@ public static IServiceCollection AddDurableTask(this IServiceCollection serviceC return serviceCollection; } + /// + /// Adds the Durable Task extension to the provided . + /// + /// The to configure. + /// Populate default configurations of to create Durable Clients. + /// Returns the provided . + public static IServiceCollection AddDurableTask(this IServiceCollection serviceCollection, Action optionsBuilder) + { + AddDurableTask(serviceCollection); + serviceCollection.Configure(optionsBuilder.Invoke); + return serviceCollection; + } + /// /// Adds the Durable Task extension to the provided . /// diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml index ef130a82c..0ccdbb2fe 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml @@ -161,11 +161,12 @@ Factory class to create Durable Client to start works outside an azure function context. - + Initializes a new instance of the class. Configuration for the Durable Functions extension. + Default Options to Build Durable Clients. @@ -174,6 +175,12 @@ options containing the client configuration parameters. Returns a instance. The returned instance may be a cached instance. + + + Gets a using configuration from a instance. + + Returns a instance. The returned instance may be a cached instance. + Factory class to create Durable Client to start works outside an azure function context. diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml index 7342b1e37..fc7535b3c 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml @@ -161,11 +161,12 @@ Factory class to create Durable Client to start works outside an azure function context. - + Initializes a new instance of the class. Configuration for the Durable Functions extension. + Default Options to Build Durable Clients. @@ -174,6 +175,12 @@ options containing the client configuration parameters. Returns a instance. The returned instance may be a cached instance. + + + Gets a using configuration from a instance. + + Returns a instance. The returned instance may be a cached instance. + Factory class to create Durable Client to start works outside an azure function context. @@ -2112,6 +2119,14 @@ The to configure. Returns the provided . + + + Adds the Durable Task extension to the provided . + + The to configure. + Populate default configurations of to create Durable Clients. + Returns the provided . + Adds the Durable Task extension to the provided . diff --git a/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs index 75b2febd8..f9b8b068a 100644 --- a/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs +++ b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs @@ -32,6 +32,9 @@ public class DurableClientOptions /// /// Indicate if the client is External from the azure function where orchestrator functions are hosted. /// - public bool IsExternalClient { get; set; } + /// + /// Default is true. + /// + public bool IsExternalClient { get; set; } = true; } } \ No newline at end of file From aa4fa324cc75ccacb0cc7ffa44f8e3e9fc42d818 Mon Sep 17 00:00:00 2001 From: David Revoledo Date: Thu, 9 Jan 2020 19:20:16 -0300 Subject: [PATCH 3/5] Add Parameterless method to IDurableClientFactory --- .../ContextImplementations/IDurableClientFactory.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs index dfd22a218..fbf4b5e49 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/IDurableClientFactory.cs @@ -16,5 +16,11 @@ public interface IDurableClientFactory /// options containing the client configuration parameters. /// Returns a instance. The returned instance may be a cached instance. IDurableClient CreateClient(DurableClientOptions durableClientOptions); + + /// + /// Gets a using configuration from a instance. + /// + /// Returns a instance. The returned instance may be a cached instance. + IDurableClient CreateClient(); } } \ No newline at end of file From b18908424ba3b600bc84a5540b30319c498557cc Mon Sep 17 00:00:00 2001 From: "davidrevoledo1@gmail.com" Date: Wed, 19 Aug 2020 20:17:28 -0300 Subject: [PATCH 4/5] Documentation changes for init durable client --- ....WebJobs.Extensions.DurableTask-net461.xml | 19 +++++++++++++++++++ ...t.Azure.WebJobs.Extensions.DurableTask.xml | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml index 0ccdbb2fe..f984695f1 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml @@ -193,6 +193,12 @@ options containing the client configuration parameters. Returns a instance. The returned instance may be a cached instance. + + + Gets a using configuration from a instance. + + Returns a instance. The returned instance may be a cached instance. + Common functionality used by both @@ -3202,6 +3208,9 @@ Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Default is true. + @@ -3359,6 +3368,16 @@ only after an entire batch of operations completes. + + + If true, takes a lease on the task hub container, allowing for only one app to process messages in a task hub at a time. + + + + + If UseAppLease is true, gets or sets the AppLeaaseOptions used for acquiring the lease to start the application. + + Sets HubName to a value that is considered a default value. diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml index fc7535b3c..8f8cb9c89 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml @@ -193,6 +193,12 @@ options containing the client configuration parameters. Returns a instance. The returned instance may be a cached instance. + + + Gets a using configuration from a instance. + + Returns a instance. The returned instance may be a cached instance. + Common functionality used by both @@ -3257,6 +3263,9 @@ Indicate if the client is External from the azure function where orchestrator functions are hosted. + + Default is true. + @@ -3414,6 +3423,16 @@ only after an entire batch of operations completes. + + + If true, takes a lease on the task hub container, allowing for only one app to process messages in a task hub at a time. + + + + + If UseAppLease is true, gets or sets the AppLeaaseOptions used for acquiring the lease to start the application. + + Sets HubName to a value that is considered a default value. From 8fff7134fdafd848d9a755229ce9de02f34c29a3 Mon Sep 17 00:00:00 2001 From: "davidrevoledo1@gmail.com" Date: Wed, 19 Aug 2020 23:24:11 -0300 Subject: [PATCH 5/5] Changes based on code review for init durable client --- .../ContextImplementations/DurableClient.cs | 32 +++++--- .../DurableClientFactory.cs | 77 +++++++++++++++++-- .../DurableTaskExtension.cs | 6 +- ...rableTaskJobHostConfigurationExtensions.cs | 5 +- .../HttpApiHandler.cs | 58 +++++++------- .../LocalHttpListener.cs | 14 ++-- ....WebJobs.Extensions.DurableTask-net461.xml | 12 ++- ...t.Azure.WebJobs.Extensions.DurableTask.xml | 12 ++- .../Options/DurableClientOptions.cs | 2 +- 9 files changed, 156 insertions(+), 62 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClient.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClient.cs index b862a9e64..09eb87291 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClient.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClient.cs @@ -38,25 +38,37 @@ internal class DurableClient : IDurableClient, private readonly DurableTaskExtension config; private readonly DurableClientAttribute attribute; // for rehydrating a Client after a webhook private readonly MessagePayloadDataConverter messageDataConverter; + private readonly DurableTaskOptions durableTaskOptions; internal DurableClient( DurabilityProvider serviceClient, - DurableTaskExtension config, HttpApiHandler httpHandler, - DurableClientAttribute attribute) + DurableClientAttribute attribute, + MessagePayloadDataConverter messageDataConverter, + EndToEndTraceHelper traceHelper, + DurableTaskOptions durableTaskOptions) { - this.config = config ?? throw new ArgumentNullException(nameof(config)); - - this.messageDataConverter = config.MessageDataConverter; + this.messageDataConverter = messageDataConverter; this.client = new TaskHubClient(serviceClient, this.messageDataConverter); this.durabilityProvider = serviceClient; - this.traceHelper = config.TraceHelper; + this.traceHelper = traceHelper; this.httpApiHandler = httpHandler; - this.hubName = attribute.TaskHub ?? config.Options.HubName; + this.durableTaskOptions = durableTaskOptions; + this.hubName = attribute.TaskHub ?? this.durableTaskOptions.HubName; this.attribute = attribute; } + internal DurableClient( + DurabilityProvider serviceClient, + DurableTaskExtension config, + HttpApiHandler httpHandler, + DurableClientAttribute attribute) + : this(serviceClient, httpHandler, attribute, config.MessageDataConverter, config.TraceHelper, config.Options) + { + this.config = config; + } + public string TaskHubName => this.hubName; internal DurabilityProvider DurabilityProvider => this.durabilityProvider; @@ -110,7 +122,7 @@ async Task IDurableOrchestrationClient.WaitForCompletionOrCreateC /// async Task IDurableOrchestrationClient.StartNewAsync(string orchestratorFunctionName, string instanceId, T input) { - if (this.ClientReferencesCurrentApp(this)) + if (!this.attribute.ExternalClient && this.ClientReferencesCurrentApp(this)) { this.config.ThrowIfFunctionDoesNotExist(orchestratorFunctionName, FunctionType.Orchestrator); } @@ -151,7 +163,7 @@ async Task IDurableOrchestrationClient.StartNewAsync(string orchestra private OrchestrationStatus[] GetStatusesNotToOverride() { - var overridableStates = this.config.Options.OverridableExistingInstanceStates; + var overridableStates = this.durableTaskOptions.OverridableExistingInstanceStates; if (overridableStates == OverridableStates.NonRunningStates) { return new OrchestrationStatus[] @@ -317,7 +329,7 @@ private bool ClientReferencesCurrentApp(DurableClient client) private bool TaskHubMatchesCurrentApp(DurableClient client) { - var taskHubName = this.config.Options.HubName; + var taskHubName = this.durableTaskOptions.HubName; return client.TaskHubName.Equals(taskHubName); } diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs index 5d41058e0..cc22f68dd 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClientFactory.cs @@ -1,30 +1,62 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; +using System.Collections.Concurrent; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Newtonsoft.Json; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations { /// /// Factory class to create Durable Client to start works outside an azure function context. /// - public class DurableClientFactory : IDurableClientFactory + public class DurableClientFactory : IDurableClientFactory, IDisposable { - private readonly DurableTaskExtension durableTaskConfig; + // Creating client objects is expensive, so we cache them when the attributes match. + // Note that DurableClientAttribute defines a custom equality comparer. + private readonly ConcurrentDictionary cachedClients = + new ConcurrentDictionary(); + + private readonly ConcurrentDictionary cachedHttpListeners = + new ConcurrentDictionary(); + private readonly DurableClientOptions defaultDurableClientOptions; + private readonly DurableTaskOptions durableTaskOptions; + private readonly IDurabilityProviderFactory durabilityProviderFactory; + private readonly ILogger logger; /// /// Initializes a new instance of the class. /// - /// Configuration for the Durable Functions extension. /// Default Options to Build Durable Clients. - public DurableClientFactory(DurableTaskExtension durableTaskConfig, IOptions defaultDurableClientOptions) + /// The factory used to create orchestration service based on the configured storage provider. + /// The logger factory used for extension-specific logging and orchestration tracking. + /// The configuration options for this extension. + /// The factory used to create for message settings. + public DurableClientFactory( + IOptions defaultDurableClientOptions, + IOptions durableTaskOptions, + IDurabilityProviderFactory orchestrationServiceFactory, + ILoggerFactory loggerFactory, + IMessageSerializerSettingsFactory messageSerializerSettingsFactory = null) { - this.durableTaskConfig = durableTaskConfig; + this.logger = loggerFactory.CreateLogger(DurableTaskExtension.LoggerCategoryName); + + this.durabilityProviderFactory = orchestrationServiceFactory; this.defaultDurableClientOptions = defaultDurableClientOptions.Value; + this.durableTaskOptions = durableTaskOptions?.Value ?? new DurableTaskOptions(); + + this.MessageDataConverter = DurableTaskExtension.CreateMessageDataConverter(messageSerializerSettingsFactory); + this.TraceHelper = new EndToEndTraceHelper(this.logger, this.durableTaskOptions.Tracing.TraceReplayEvents); } + internal MessagePayloadDataConverter MessageDataConverter { get; private set; } + + internal EndToEndTraceHelper TraceHelper { get; private set; } + /// /// Gets a using configuration from a instance. /// @@ -32,12 +64,34 @@ public DurableClientFactory(DurableTaskExtension durableTaskConfig, IOptionsReturns a instance. The returned instance may be a cached instance. public IDurableClient CreateClient(DurableClientOptions durableClientOptions) { + if (durableClientOptions == null) + { + throw new ArgumentException("Please configure 'DurableClientOptions'"); + } + if (string.IsNullOrWhiteSpace(durableClientOptions.TaskHub)) { - durableClientOptions.TaskHub = DurableTaskOptions.DefaultHubName; + throw new ArgumentException("Please provide value for 'TaskHub'"); } - return this.durableTaskConfig.GetClient(new DurableClientAttribute(durableClientOptions)); + DurableClientAttribute attribute = new DurableClientAttribute(durableClientOptions); + + HttpApiHandler httpApiHandler = this.cachedHttpListeners.GetOrAdd( + attribute, + attr => + { + return new HttpApiHandler(null, null, this.durableTaskOptions, this.logger); + }); + + DurableClient client = this.cachedClients.GetOrAdd( + attribute, + attr => + { + DurabilityProvider innerClient = this.durabilityProviderFactory.GetDurabilityProvider(attribute); + return new DurableClient(innerClient, httpApiHandler, attribute, this.MessageDataConverter, this.TraceHelper, this.durableTaskOptions); + }); + + return client; } /// @@ -48,5 +102,14 @@ public IDurableClient CreateClient() { return this.CreateClient(this.defaultDurableClientOptions); } + + /// + public void Dispose() + { + foreach (var cachedHttpListener in this.cachedHttpListeners) + { + cachedHttpListener.Value?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 190da9bca..5b0c05196 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -43,7 +43,7 @@ public class DurableTaskExtension : INameVersionObjectManager, INameVersionObjectManager { - private static readonly string LoggerCategoryName = LogCategories.CreateTriggerCategory("DurableTask"); + internal static readonly string LoggerCategoryName = LogCategories.CreateTriggerCategory("DurableTask"); // Creating client objects is expensive, so we cache them when the attributes match. // Note that DurableClientAttribute defines a custom equality comparer. @@ -132,7 +132,7 @@ public DurableTaskExtension( DurableHttpClientFactory durableHttpClientFactory = new DurableHttpClientFactory(); this.durableHttpClient = durableHttpClientFactory.GetClient(durableHttpMessageHandlerFactory); - this.MessageDataConverter = this.CreateMessageDataConverter(messageSerializerSettingsFactory); + this.MessageDataConverter = CreateMessageDataConverter(messageSerializerSettingsFactory); this.ErrorDataConverter = this.CreateErrorDataConverter(errorSerializerSettingsFactory); this.HttpApiHandler = new HttpApiHandler(this, logger); @@ -188,7 +188,7 @@ public string HubName internal MessagePayloadDataConverter ErrorDataConverter { get; private set; } - private MessagePayloadDataConverter CreateMessageDataConverter(IMessageSerializerSettingsFactory messageSerializerSettingsFactory) + internal static MessagePayloadDataConverter CreateMessageDataConverter(IMessageSerializerSettingsFactory messageSerializerSettingsFactory) { bool isDefault; if (messageSerializerSettingsFactory == null) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index 6da76f960..2afdcc8fb 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -62,14 +62,11 @@ public static IServiceCollection AddDurableTask(this IServiceCollection serviceC throw new ArgumentNullException(nameof(serviceCollection)); } - serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); - serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); - serviceCollection.TryAddSingleton(); - serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); + serviceCollection.TryAddSingleton(); return serviceCollection; } diff --git a/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs b/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs index c65e21894..0c3dd05b7 100644 --- a/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs +++ b/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs @@ -61,23 +61,37 @@ internal class HttpApiHandler : IDisposable private static readonly TemplateMatcher InstancesRoute = GetInstancesRoute(); private static readonly TemplateMatcher InstanceRaiseEventRoute = GetInstanceRaiseEventRoute(); - private readonly DurableTaskExtension config; private readonly ILogger logger; private readonly MessagePayloadDataConverter messageDataConverter; private readonly LocalHttpListener localHttpListener; + private readonly EndToEndTraceHelper traceHelper; + private readonly DurableTaskOptions durableTaskOptions; + private readonly DurableTaskExtension config; - public HttpApiHandler(DurableTaskExtension config, ILogger logger) + public HttpApiHandler( + EndToEndTraceHelper traceHelper, + MessagePayloadDataConverter messageDataConverter, + DurableTaskOptions durableTaskOptions, + ILogger logger) { - this.config = config; - this.messageDataConverter = this.config.MessageDataConverter; + this.messageDataConverter = messageDataConverter; this.logger = logger; + this.durableTaskOptions = durableTaskOptions; + this.traceHelper = traceHelper; // The listen URL must not include the path. this.localHttpListener = new LocalHttpListener( - config, + this.traceHelper, + this.durableTaskOptions, this.HandleRequestAsync); } + public HttpApiHandler(DurableTaskExtension config, ILogger logger) + : this(config.TraceHelper, config.MessageDataConverter, config.Options, logger) + { + this.config = config; + } + public void Dispose() { this.localHttpListener.Dispose(); @@ -215,9 +229,9 @@ public async Task HandleRequestAsync(HttpRequestMessage req { basePath = this.localHttpListener.InternalRpcUri.AbsolutePath; } - else if (this.config.Options.NotificationUrl != null) + else if (this.durableTaskOptions.NotificationUrl != null) { - basePath = this.config.Options.NotificationUrl.AbsolutePath; + basePath = this.durableTaskOptions.NotificationUrl.AbsolutePath; } else { @@ -550,15 +564,7 @@ private async Task HandleGetStatusRequestAsync( // The orchestration has failed - return 500 w/out Location header case OrchestrationRuntimeStatus.Failed: - if (returnInternalServerErrorOnFailure) - { - statusCode = HttpStatusCode.InternalServerError; - } - else - { - statusCode = HttpStatusCode.OK; - } - + statusCode = returnInternalServerErrorOnFailure ? HttpStatusCode.InternalServerError : HttpStatusCode.OK; location = null; break; @@ -901,7 +907,7 @@ internal string GetBaseUrl() { this.ThrowIfWebhooksNotConfigured(); - Uri notificationUri = this.config.Options.NotificationUrl; + Uri notificationUri = this.durableTaskOptions.NotificationUrl; string hostUrl = notificationUri.GetLeftPart(UriPartial.Authority); return hostUrl + notificationUri.AbsolutePath.TrimEnd('/'); @@ -911,7 +917,7 @@ internal string GetUniversalQueryStrings() { this.ThrowIfWebhooksNotConfigured(); - Uri notificationUri = this.config.Options.NotificationUrl; + Uri notificationUri = this.durableTaskOptions.NotificationUrl; return !string.IsNullOrEmpty(notificationUri.Query) ? notificationUri.Query.TrimStart('?') @@ -943,7 +949,7 @@ private HttpManagementPayload GetClientResponseLinks( { this.ThrowIfWebhooksNotConfigured(); - Uri notificationUri = this.config.Options.NotificationUrl; + Uri notificationUri = this.durableTaskOptions.NotificationUrl; Uri baseUri = request?.RequestUri ?? notificationUri; // e.g. http://{host}/runtime/webhooks/durabletask?code={systemKey} @@ -952,7 +958,7 @@ private HttpManagementPayload GetClientResponseLinks( string allInstancesPrefix = baseUrl + "/" + InstancesControllerSegment; string instancePrefix = allInstancesPrefix + WebUtility.UrlEncode(instanceId); - string taskHub = WebUtility.UrlEncode(taskHubName ?? this.config.Options.HubName); + string taskHub = WebUtility.UrlEncode(taskHubName ?? this.durableTaskOptions.HubName); string connection = WebUtility.UrlEncode(connectionName ?? this.config.GetDefaultConnectionName()); string querySuffix = $"{TaskHubParameter}={taskHub}&{ConnectionParameter}={connection}"; @@ -1007,7 +1013,7 @@ private HttpResponseMessage CreateCheckStatusResponseMessage( private void ThrowIfWebhooksNotConfigured() { - if (this.config.Options.NotificationUrl == null) + if (this.durableTaskOptions.NotificationUrl == null) { throw new InvalidOperationException("Webhooks are not configured"); } @@ -1015,7 +1021,7 @@ private void ThrowIfWebhooksNotConfigured() internal bool TryGetRpcBaseUrl(out Uri rpcBaseUrl) { - if (this.config.Options.LocalRpcEndpointEnabled != false) + if (this.durableTaskOptions.LocalRpcEndpointEnabled != false) { rpcBaseUrl = this.localHttpListener.InternalRpcUri; return true; @@ -1031,8 +1037,8 @@ internal async Task StartLocalHttpServerAsync() { if (!this.localHttpListener.IsListening) { - this.config.TraceHelper.ExtensionInformationalEvent( - this.config.Options.HubName, + this.traceHelper.ExtensionInformationalEvent( + this.durableTaskOptions.HubName, instanceId: string.Empty, functionName: string.Empty, message: $"Opening local RPC endpoint: {this.localHttpListener.InternalRpcUri}", @@ -1046,8 +1052,8 @@ internal async Task StopLocalHttpServerAsync() { if (this.localHttpListener.IsListening) { - this.config.TraceHelper.ExtensionInformationalEvent( - this.config.Options.HubName, + this.traceHelper.ExtensionInformationalEvent( + this.durableTaskOptions.HubName, instanceId: string.Empty, functionName: string.Empty, message: $"Closing local RPC endpoint: {this.localHttpListener.InternalRpcUri}", diff --git a/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs b/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs index 9aafdbe8e..9d31281f1 100644 --- a/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs +++ b/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs @@ -22,16 +22,20 @@ internal class LocalHttpListener : IDisposable { private const int DefaultPort = 17071; - private readonly DurableTaskExtension extension; private readonly IWebHost localWebHost; private readonly Func> handler; + private readonly EndToEndTraceHelper traceHelper; + private readonly DurableTaskOptions durableTaskOptions; public LocalHttpListener( - DurableTaskExtension extension, + EndToEndTraceHelper traceHelper, + DurableTaskOptions durableTaskOptions, Func> handler) { - this.extension = extension ?? throw new ArgumentNullException(nameof(extension)); + this.traceHelper = traceHelper ?? throw new ArgumentNullException(nameof(traceHelper)); this.handler = handler ?? throw new ArgumentNullException(nameof(handler)); + this.durableTaskOptions = durableTaskOptions ?? throw new ArgumentNullException(nameof(durableTaskOptions)); + #if !FUNCTIONS_V1 this.InternalRpcUri = new Uri($"http://127.0.0.1:{this.GetAvailablePort()}/durabletask/"); var listenUri = new Uri(this.InternalRpcUri.GetLeftPart(UriPartial.Authority)); @@ -114,8 +118,8 @@ private async Task HandleRequestAsync(HttpContext context) } catch (Exception e) { - this.extension.TraceHelper.ExtensionWarningEvent( - this.extension.Options.HubName, + this.traceHelper.ExtensionWarningEvent( + this.durableTaskOptions.HubName, functionName: string.Empty, instanceId: string.Empty, message: $"Unhandled exception in HTTP API handler: {e}"); diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml index f984695f1..a204d1975 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net461.xml @@ -161,12 +161,15 @@ Factory class to create Durable Client to start works outside an azure function context. - + Initializes a new instance of the class. - Configuration for the Durable Functions extension. Default Options to Build Durable Clients. + The factory used to create orchestration service based on the configured storage provider. + The logger factory used for extension-specific logging and orchestration tracking. + The configuration options for this extension. + The factory used to create for message settings. @@ -181,6 +184,9 @@ Returns a instance. The returned instance may be a cached instance. + + + Factory class to create Durable Client to start works outside an azure function context. @@ -3196,7 +3202,7 @@ - Optional. Gets or sets the name of the task hub in which the orchestration data lives. + Gets or sets the name of the task hub in which the orchestration data lives. The task hub used by this binding. diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml index 8f8cb9c89..06d00ef01 100644 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml +++ b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask.xml @@ -161,12 +161,15 @@ Factory class to create Durable Client to start works outside an azure function context. - + Initializes a new instance of the class. - Configuration for the Durable Functions extension. Default Options to Build Durable Clients. + The factory used to create orchestration service based on the configured storage provider. + The logger factory used for extension-specific logging and orchestration tracking. + The configuration options for this extension. + The factory used to create for message settings. @@ -181,6 +184,9 @@ Returns a instance. The returned instance may be a cached instance. + + + Factory class to create Durable Client to start works outside an azure function context. @@ -3251,7 +3257,7 @@ - Optional. Gets or sets the name of the task hub in which the orchestration data lives. + Gets or sets the name of the task hub in which the orchestration data lives. The task hub used by this binding. diff --git a/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs index f9b8b068a..ad1f2c729 100644 --- a/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs +++ b/src/WebJobs.Extensions.DurableTask/Options/DurableClientOptions.cs @@ -20,7 +20,7 @@ public class DurableClientOptions public string ConnectionName { get; set; } /// - /// Optional. Gets or sets the name of the task hub in which the orchestration data lives. + /// Gets or sets the name of the task hub in which the orchestration data lives. /// /// The task hub used by this binding. ///