diff --git a/src/Dapr.Workflow/Dapr.Workflow.csproj b/src/Dapr.Workflow/Dapr.Workflow.csproj index 48a57eb17..14f590ba6 100644 --- a/src/Dapr.Workflow/Dapr.Workflow.csproj +++ b/src/Dapr.Workflow/Dapr.Workflow.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Dapr.Workflow/WorkflowEngineClient.cs b/src/Dapr.Workflow/WorkflowEngineClient.cs index 640bacd30..e808483dd 100644 --- a/src/Dapr.Workflow/WorkflowEngineClient.cs +++ b/src/Dapr.Workflow/WorkflowEngineClient.cs @@ -18,10 +18,13 @@ namespace Dapr.Workflow using Microsoft.DurableTask; using Microsoft.DurableTask.Client; - // TODO: This will be replaced by the official Dapr Workflow management client. /// /// Defines client operations for managing Dapr Workflow instances. /// + /// + /// This is an alternative to the general purpose Dapr client. It uses a gRPC connection to send + /// commands directly to the workflow engine, bypassing the Dapr API layer. + /// public sealed class WorkflowEngineClient : IAsyncDisposable { readonly DurableTaskClient innerClient; @@ -70,7 +73,7 @@ public Task ScheduleNewWorkflowAsync( /// public async Task GetWorkflowStateAsync(string instanceId, bool getInputsAndOutputs = false) { - OrchestrationMetadata? metadata = await this.innerClient.GetInstanceMetadataAsync( + OrchestrationMetadata? metadata = await this.innerClient.GetInstancesAsync( instanceId, getInputsAndOutputs); return new WorkflowState(metadata); diff --git a/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs b/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs index d14113eeb..6e384954f 100644 --- a/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs +++ b/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs @@ -53,7 +53,13 @@ static bool TryGetGrpcAddress(out string address) string? daprPortStr = Environment.GetEnvironmentVariable("DAPR_GRPC_PORT"); if (int.TryParse(Environment.GetEnvironmentVariable("DAPR_GRPC_PORT"), out int daprGrpcPort)) { + // There is a bug in the Durable Task SDK that requires us to change the format of the address + // depending on the version of .NET that we're targeting. For now, we work around this manually. +#if NET6_0_OR_GREATER + address = $"http://localhost:{daprGrpcPort}"; +#else address = $"localhost:{daprGrpcPort}"; +#endif return true; } diff --git a/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj b/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj index 3df269709..10ae69b38 100644 --- a/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj +++ b/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj @@ -4,7 +4,7 @@ - +