dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.82k stars 458 forks source link

Dapr Binding Trigger is not working with Aspire #4883

Open heavenwing opened 3 months ago

heavenwing commented 3 months ago

Is there an existing issue for this?

Describe the bug

Enable dapr input binding, daprd cannot trigger api after receiving message from queue broker (like RabbitMQ). If I execute dotnet run and dapr run command directly (without Aspire runtime), daprd can trigger api. Please check more information from Steps To Reproduce

Expected Behavior

Dapr sidecar can trigger Aspire application.

Steps To Reproduce

  1. Run RabbitMQ service with Docker or other container.
  2. Clone repo https://github.com/msyoz/NotificationPoc
  3. F5 to start Aspire applications, it will start 3 Projects and 2 Executable
  4. Access https://localhost:7186/swagger, try /api/Send, it will use daprClient.InvokeBindingAsync at line 22 of SendController to send message into binding-notification queue.
  5. But daprd don't trigger dapr input binding, if it's working, ServiceController's Send action should be invoked.

Exceptions (if any)

No response

.NET Version info

.NET SDK: Version: 8.0.303 Commit: 29ab8e3268 Workload version: 8.0.300-manifests.7ccdde63 MSBuild version: 17.10.4+10fbfbf2e

Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.303\

.NET workloads installed: [aspire] Installation Source: SDK 8.0.300, VS 17.10.35027.167 Manifest Version: 8.0.2/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.2\WorkloadManifest.json Install Type: Msi

[wasm-tools] Installation Source: SDK 8.0.300, VS 17.10.35027.167 Manifest Version: 8.0.7/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.7\WorkloadManifest.json Install Type: Msi

Host: Version: 8.0.7 Architecture: x64 Commit: 2aade6beb0

.NET SDKs installed: 3.1.426 [C:\Program Files\dotnet\sdk] 6.0.424 [C:\Program Files\dotnet\sdk] 8.0.107 [C:\Program Files\dotnet\sdk] 8.0.303 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Anything else?

dotnet workload list

Installed Workload Id Manifest Version Installation Source

aspire 8.0.2/8.0.100 SDK 8.0.300, VS 17.10.35027.167

Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.10.4

davidfowl commented 2 months ago

I'm guessing this is a rabbit mq specific problem because the dapr bindings don't retry to connect to rabbitmq if it's not fully running. What do the logs say?