-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
Native AOT with .NET 8 #1095
Comments
I haven't tried it yet 🙂 but if I understand things correctly, it's not reflection as such that causes things to break, it's more when reflection is used to load types that the AOT analyzer cannot predict are going to be loaded... and I can't recall any situations where Rebus does that. E.g. I would assume that the AOT system will know that your handler is needed, because you did something like this: services.AddRebusHandler<YourMessageHandler>(); so that type and its dependencies should be kept. But I might be wrong 😅 it would be fun to try though. |
@SbiCA Did you ever have a chance to try out Rebus with AOT? Was there a determination of whether or not it works? |
@dguisinger nope I'm afraid not so if you made first experience I'd also be interested 😅 |
@SbiCA hah, I've recently ripped out AutoMapper and MediatR because they didn't work with AoT and the project owner doesn't want to put time into making it work. I then spent time looking into Mass Transit and then realized it also doesn't work with AoT and their project owner has a similar attitude. I've pretty much given up on non-Microsoft frameworks at this point and don't want to waste more time evaluating things just to find they don't work with modern framework runtime options. Kind of disappointed MSFT just said they are holding back their event framework due to complaints... I bet it would have worked just fine out of the box. |
@dguisinger agreed that's a pity because IHMO I think it could become a benefit for libs as well so you don't have to maintain all that and it could be more focused on the thing the do best. I like rebus for it's "simplicity" and the docs for instance. Not sure what @mookid8000 thinks of the development? I think it could be some advantage but then on the I'm not sure how much this would push rebus towards something more integrated such as https://wolverinefx.net/ 🤔 |
@SbiCA I would love to support AOT, but I haven't tried it, so I don't even know if it maybe already works? Has anyone tried publishing with the flag turned on? if so, how did it go? |
@mookid8000 sorry for the async feedback loop didn't try it so far because I know in our project we first have to ged rid of a few other dependencies that will for sure not work nicely with AOT. as a side quest did you already checkout dotnet/aspnetcore#53219 (comment) the new "messaging" middleware and if it's going to happen because if so that might save a lot of work 🤔 |
@SbiCA Yeah I followed that thread since the beginning 😅 It's of course interesting to see how Microsoft's common eventing framework is going to turn out. From @davidfowl's code sketch it sure looks like it could be super neat and easy to get started with. For now, I'm just sitting here with 🍿 , and then I'll see what opportunities unfold as it progresses. |
@mookid8000 update from my end: sorry didn't get to it due to other prios(interrupts) I'll try again the following two weeks 🤞 |
@mookid8000 finally got some time. here is a working sample with in memory transport but I had to use STJ I'd still like to give it a try with a real world transport to make sure those work as well, but I guess at least a good start 😄 |
@mookid8000 just finished sqs play time and it seems to work as well (at least with this minimal demo) Not sure if we can say it's safe to use with native AOT or can you see some troublesome scenarios e.g. TypeBasedRouter using reflection that wouldn't be allowed? |
Hi @mookid8000
Did you already try out using rebus with native AOT in .NET 8?
Do you already have an idea what's going to break? I guess the Router and Handler discovery might be affected?
Cheers
For people interested in it see https://youtu.be/km9CnGYBafI
The text was updated successfully, but these errors were encountered: