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
Port to .NET core #358
Comments
I was able to run rebus + rabbitmq with mono inside docker container :) |
Cool! and that just worked? |
Yip serilog was broken but got around it with the beta packages
|
Is this something you are working on? |
I'm currently watching the .NET Core progress, waiting for things to settle down just a bit before I do too much. So I'm not actively working on it, but I am definitely planning on doing it :) |
Hi, |
Thanks for reminding me 😄 and yes, I did notice that - in fact I've installed it both on my Mac and in my Windows VM. My plan is to play around with releasing some of my smaller things on .NET Core first, e.g. Tababular and Injectionist |
Any updates on this? |
Not really – is it something you would find interesting? |
No, currently not. But would be cool to see Rebus services running on Linux ^^ |
Looking pretty close to having all dependencies there to port to .net core https://icanhasdot.net/result?github=rebus-org~2Frebus |
As a DevOps enthousiast I think the release of NET Core is awesome, I'm playing with .NET Core, Docker and NGINX in a pet project and absolutely love it. Don't underestimate the effort that will go into supporting .NET Core: I hacked together a PoC version of Rebus that supports .NET Standard 1.5 with RabbitMQ and StructureMap, it's nothing near finished and didn't even run the unit tests: https://github.com/bertvansteen/Rebus/tree/netcore-rabbitmq-structuremap-poc Some notes:
I hope this helps in better understanding the effort required for supporting .NET Core. |
@bertvansteen thank you so much for reporting your experiences 👍 I don't understand fully how these things work yet.... I know .NETStandard 1.1 corresponds to .NET 4.5... are the .NETStandard targets backwards compatible, such that it would be possible to target .NETStandard 1.1 and thus support all newer platforms? |
This is an experiment for me too. It appears that most of the compiler errors disappear when targetting .NET Standard 1.5 (supported in .NET 4.6.2 and .NET core) which is a superset of 1.4 which in turn is a superset... We have to target multiple frameworks and use compiler directives to support .NET 4.5, I've updated my PoC branch, I also fixed the unit testing discovery issue for .NET 4.5. (but autodata doesn't work yet) You might want to consider removing the MSMQ transport and SQL Server persistance from the core project and move it to a separate assembly like RabbitMQ or Redis because commenting out a large chunk of code with compiler directives is not the way to go. Both versions of Rebus should more or less contain the same features and it might take a while before Microsoft releases a .NET Standard compatible version of the MSMQ connector since it's a Windows only product. Some more notes:
|
I have been messing around a little bit with these things. Rebus has not been split into separate repositories, which was a prerequisite in order to be able to commence porting the code to .NET Core. As far as I can tell, it will be valid to use the following approach:
I have tried to port the code to the |
Been playing with the conversion of Rebus to .net core as well on my fork ([https://github.com/mvandevy/Rebus]) and been able to get it working as expected. All unit tests run green after some initial bug hunting. Probably made some suboptimal choices along the way, but wanted to get it running & testable. I've used the suggestions made by @bertvansteen to have an initial PoC running. What are there any plans to start the making the libraries .net core compatible? |
well.... I'm not sure I have thought it through yet – but I was thinking of making it .NET Core compatible and then call it "Rebus 3".... but I guess that is not even necessary – it should be possible to compile a Rebus 2.2.0 even (the 2.1.6 version is the most recent on NuGet.org), simply adding a "lib/DNXORWHATEVERITISCALLEDTHESEDAYS" folder in addition to the existing "lib/NET45" folder in the NuGet package, right? |
That's a huge step btw., so that is just awesome! |
From the project.json it does not seem like you are targeting .NET 4.5 too – is there something I am missing? |
You are right, I'm not yet targeting .NET 4.5. Thats the next step, just wanted to make sure that it worked on .net core first. Maybe you've already tried converting it and keeping it compatible with .NET 4.5. If that's the case, then I've missed that change/issue where you did something similar and mentioned it. Anyway, by your response it seems I have some more work ahead before you'll accept a pull request ;-) |
well..... I would love a PR, but I don't want to obstruct the current line of development with Rebus.... I will accept your PR anytime, but I would like to keep it on a separate branch for now. Just let me know when you feel like contributing it – then I will set up the branch 😄 |
I'll let you know when I have something decent to put into a branch. Hopefully rather sooner than later. One of the most prominent breaking changes on .net core is the disappearance of the 'ApplicationException' base class. That caused me a headache at first while running the tests, especially in the 'TestRetryExceptionCustomization' test as I used the 'Exception' class as a replacement for the 'ApplicationException' class. I've also the tests to Xunit, because didn't have the time yet to play around with NUnit on .net core. One thing to mention about this, is that the test suite doesn't really like to be executed in a parallel mode ;-) |
🤘
I actually thought I had replaced all usage of
ah, bummer – but aren't almost all of the tests running on the in-mem transport? do you know if there is a way to create "mutual exclusion groups" of tests, or somehow affect what gets to run in parallel and what needs to be serialized? |
Thanks to @mvandevy 's persistence and hard work, I have now adapted build scripts and stuff and figured out how to release this betaversion of Rebus that targets .NET 4.5 and .NET Core (in the form of netstandard1.6). Check this out: I have done the same things to Rebus.Serilog, Rebus.SqlServer, Rebus.RabbitMq, and Rebus.Autofac, so it should actually be possible now to get an endpoint up and running with all areas covered. Thanks @mvandevy for kicking me until I could no longer ignore you 🤜 😁 |
Great news! Thanks for the effort of getting it published! |
I'll keep track of the status here:
🏖 : means that the package has no dependencies |
If anyone plays around with the new 4.0.0-b?? versions, it would be awesome if you would post your experiences here.... I am interested in hearing about full .NET framework experiences just as well as .NET Core experiences. |
The ASB Team is working on a .NET core compliant SDK. https://github.com/Azure/azure-service-bus-dotnet it is just a question of how long it takes ;) |
Here's the steps I go through when porting a project: 0. Don't open the solution fileUsing Visual Studio 2017, control yourself and refrain from opening up the 1. Edit
|
BTW, would anyone be interested in a Rebus.MySql project which is also .net standard compatible? Just happened to have this lying around. 😁 |
I don't have that need myself, but I think it would be a pretty cool addition! |
OK, let me clean it up a little so I can point you to it. Or would you want to create a repo for this, with the basic stuff in it, so I can create a pull request? |
I'll create the repo – this way, you can send a PR and have your name all over it 😄 |
ALL projects have now been ported to the new project structure, and those whose dependencies do not prevent it are targeting .NET Standard 1.6 in addition to the usual .NET 4.5 (or in some cases 4.5.1 / 4.5.2) The core Rebus package is out in version 4.0.0-b10, and all the most recent versions of the other packages depend on this particular version. All packages are out in prerelease versions. It would be awesome if someone would check it out, no matter if they're on .NET Core or on the full .NET framework. 🤗 |
Great work to all of those involved! |
Azure Service Bus is now available for .Net Core. |
🤘 soon! (as in: one of the following days) |
Be aware that it lacks a few things like SendsWithAtomicReceive and has a breaking change in how it treats stream messages that might not be backwards compat depending on how the previous client was used
… Am 15.08.2017 um 08:24 schrieb Mogens Heller Grabe ***@***.***>:
🤘
soon! (as in: one of the following days)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ah, thanks for warning me – it'll be interesting to see how much of the API surface I am currently using can be translated directly to the new driver. |
hi @mookid8000, any expected date on a release of Rebus.AzureServiceBus that support .net core? |
Unfortunately, it turned out that the new driver implementation had been changed radically, compared to the old driver, especially with regards to receiving messages. I think I will get some time next week where I can see if I can make something work. |
@mookid8000 thank you for this awesome work on getting Rebus onto supporting .NET Core. It's a bummer with Rebus.AzureServiceBus though, but we can already use it as is right now, at least on windows. |
Any updates on the status of Rebus? Can we use it in ASP.NET Core 2.1? Thanks |
Yes, Rebus has supported .NET Core since March 2017 😄 Rebus 4 is built targeting .NET 4.5 and .NET Standard 1.3, and Rebus 5 will add .NET Standard 2 as a target too. |
@mookid8000 Im new to this and I am bit confused about Rebus. Is it just a bus? I see, there is Rebus.AzureServiceBus, Rebus.RabbitMq, Rebus.AzureStorage, Rebus.PostgreSql, and other packages? What's the deal here, what is exactly Rebus and why having all those packages? I am switching to CQRS now. Thanks |
Rebus provides implementations of common messaging patterns like request/reply, publish/subscriber, correlation ID, process manager, dead-letter queues, claim check, etc. It does so in a way that makes your code portable across transports, so you can e.g. start out by configuring it to work with RabbitMQ. Later, if you need to move your system to the cloud, you can configure it to use Azure Service Bus. Or Amazon SQS. In addition to this, it makes coding event-driven applications pleasant, because its APIs are quire simple and approachable 😄 If you are curious to read about Rebus, I suggest you go look at the wiki – it has explanations for most concepts. If you want to see code that uses Rebus, you can check out the RebusSamples repository |
That's an amazing explanation @mookid8000 I am reading and learning CQRS, DDD and such patterns nowadays and want to apply those concepts to a real-life app. There are many micro frameworks out there on Github that can handle messaging, etc. That's why the options are many :-) When you say request/reply, does that correspond to commands? Typically, when you execute a command, you need an answer to the client (accepted or not at least). As for publishing/subscriber, it reminds me more of handling Domain Events and Event Sourcing? Or am I talking about something else? What about the event store? Does Rebus support that? Because with event sourcing you need the event store to persist the events, etc. Process Manager, are we talking about a "Saga"? I will for sure check out the wiki and the samples! Thanks |
Yes, it's typically a command where the sender is somehow interested in the result. In code it could look like this (at the client's end and the "Inventory Service"'s end, respectively): // at the client end:
await bus.Send(new MakeInventoryAllocation(...));
// and then in the "Inventory Service":
await bus.Reply(new MakeInventoryAllocationReply(
success: couldMakeInventoryAllocation,
correlationId: correlationIdFromCommand
));
If you work with event sourcing, you typically need stronger ordering guarantees than what a library like Rebus can provide (because it runs on message queues and often will process messages in parallel, either by multiple threads or even in multiple processes).
No 😄 Rebus runs on message queues. You could of course model a message queue on top of an event store, but if you want to use a real event store, it's probably more fun to code your app such that it takes advantage of all of the extra guarantees that it provides.
Yes 😄 it's called "Saga" because Rebus started out as a copy of the functionality I liked from NServiceBus, so that word stuck. It's called a "Process Manager" in the literature though, so I usually use that word. Also, "Sagas" usually imply you use some kind of compensating actions for steps that fail or otherwise cannot be completed, but that's in no way required with Rebus. |
No description provided.
The text was updated successfully, but these errors were encountered: