Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support AOT across Dapr clients #1447

Open
c-ramin opened this issue Jan 15, 2025 · 3 comments
Open

Feature: Support AOT across Dapr clients #1447

c-ramin opened this issue Jan 15, 2025 · 3 comments
Labels
area/client kind/enhancement New feature or request
Milestone

Comments

@c-ramin
Copy link

c-ramin commented Jan 15, 2025

Expected Behavior

In a project where subscriptions are made via the bus using .WithTopic("name", nameof(class)), I would like the MapSubscribeHandler to work correctly in AOT (Ahead-Of-Time) mode.
Currently, it seems that AOT is not fully supported in this scenario, which leads to issues when using Dapr with this pattern. It would be great if this functionality could be improved to support AOT seamlessly.

Actual Behavior

At startup, the application throws the following error, which I believe is related to the Subscription class in the following line of code:
https://github.com/dapr/dotnet-sdk/blob/master/src/Dapr.AspNetCore/DaprEndpointRouteBuilderExtensions.cs#L189

Image

Steps to Reproduce the Problem

=> Project c# 9 aot
=> Juste add enpoint with WithTopic
=> and use compoenent type: pubsub.rabbitmq
=> Start service

Release Note

RELEASE NOTE: FIX support AOT when subscribing with the bus

@c-ramin c-ramin added the kind/bug Something isn't working label Jan 15, 2025
@WhitWaldo
Copy link
Contributor

@c-ramin To my knowledge, none of the Dapr .NET SDK is compatible with AOT (at least not intentionally - it's not something we test for), but it's certainly something we can look at adding in an upcoming release.

@WhitWaldo WhitWaldo added kind/enhancement New feature or request area/client and removed kind/bug Something isn't working labels Jan 15, 2025
@WhitWaldo WhitWaldo added this to the Future milestone Jan 15, 2025
@c-ramin
Copy link
Author

c-ramin commented Jan 15, 2025

Thank you again for your response. To my knowledge, the client (http) dapr part works correctly in native mode with AOT. However, in my case, subscriptions are the primary feature I'm interested in. I would be delighted if Dapr could consider supporting this in a future release.

@WhitWaldo
Copy link
Contributor

@c-ramin Certainly - using the HTTP API doesn't utilize any of the Dapr .NET SDK bits, so you're just using .NET functionality itself which is certainly optimized for AOT.

We're wrapping up 1.15 right now but I'll do some research on what's involved.

@WhitWaldo WhitWaldo changed the title Dapr does not support AOT when subscribing with the bus ("MapSubscribeHandler") Feature: Support AOT across Dapr clients Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants