EasyNetQ / EasyNetQ

An easy to use .NET API for RabbitMQ

Home Page:http://easynetq.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making EasyNetQ compatible with .NET Core and other .NET Platforms

micdenny opened this issue · comments

These are the steps that remains to port on .NET Core:

  • 1. fix the code on EasyNetQ to be netcore compatible
  • 2. port EasyNetQ.Management to netcore, because it is needed for EasyNetQ.Tests
  • 3. convert all the unit test to use xunit, that is the best choice for netcore as far as I understood
  • 4. fix the build stuff and start to build from appveyor also the feature branch creating pre-release package

main PR for this is #606

Is there any movement on this? As .NET Core has hit RTM now, this would be fantastic.

Seems like official Rabbitmq client is available now on .NET Core as a pre-release https://groups.google.com/forum/#!searchin/rabbitmq-users/AppVeyor/rabbitmq-users/hyJLlXCbocY/IEWxno3oAwAJ

Any updates on this one? I am happy to help out if it would be beneficial.

We have a PR that uses the RabbitMQ appveyor pre-release version, but we haven't fixed the release process yet. Also we're not going to release it before the RabbitMQ client is released.

#589, if you could test this PR by building it from source, that would be great!

Could you please publish prerelease version, so we at least can start developing our apps?

Yes, prerelease packae would be super amazing.

I will test the PR today as well.

We are working on that, we already moved on appveyor ENQ official packaging, now we will move on gitflow to be able to have also pre-release packages, but I need some more time.

In the meanwhile you can use the nuget package in the artifact you can find from the builded PR by appveyor. I can also push this PR package in our MyGet repo, I don't like to push it as is in nuget.org repo just because is an irreversible operation and I wait to have the proper branch for that, and anyway to test would be better to have one more stage when we're still in PR review, so for this the idea to take the artifact and push to MyGet. What do you think? would be ok for you?

Yep, that will be at least something to start with ) Thanks

I've created an ENQ MyGet feed, but I think also the nuspec must be fixed, anyway this is the feed url:

https://www.myget.org/F/easynetq-unstable/api/v3/index.json

but trying adding the package on a netcore project gives this error:

Retrieving package 'EasyNetQ 0.61.1.444' from 'EasyNetQ Unstable'.
  GET https://www.myget.org/F/easynetq-unstable/api/v3/flatcontainer/easynetq/0.61.1.444/easynetq.0.61.1.444.nupkg
  OK https://www.myget.org/F/easynetq-unstable/api/v3/flatcontainer/easynetq/0.61.1.444/easynetq.0.61.1.444.nupkg 631ms
Installing EasyNetQ 0.61.1.444.
Installing NuGet package EasyNetQ.0.61.1.444.
Successfully installed 'EasyNetQ 0.61.1.444' to ConsoleApp3
Executing nuget actions took 1,29 sec
========== Finished ==========
Time Elapsed: 00:00:12.8251779
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe restore "c:\users\micde\documents\visual studio 2015\Projects\ConsoleApp3\.vs\restore.dg"
log  : Restoring packages for c:\users\micde\documents\visual studio 2015\Projects\ConsoleApp3\src\ConsoleApp3\project.json...
error: Package EasyNetQ 0.61.1.444 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package EasyNetQ 0.61.1.444 supports: net45 (.NETFramework,Version=v4.5)
error: Package RabbitMQ.Client 3.6.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package RabbitMQ.Client 3.6.0 supports:
error:   - net45 (.NETFramework,Version=v4.5)
error:   - netcore45 (.NETCore,Version=v4.5)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
log  : Writing lock file to disk. Path: c:\users\micde\documents\visual studio 2015\Projects\ConsoleApp3\src\ConsoleApp3\project.lock.json
log  : c:\users\micde\documents\visual studio 2015\Projects\ConsoleApp3\src\ConsoleApp3\ConsoleApp3.xproj
log  : Restore failed in 582ms.
Errors in c:\users\micde\documents\visual studio 2015\Projects\ConsoleApp3\src\ConsoleApp3\ConsoleApp3.xproj
    Package EasyNetQ 0.61.1.444 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package EasyNetQ 0.61.1.444 supports: net45 (.NETFramework,Version=v4.5)
    Package RabbitMQ.Client 3.6.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package RabbitMQ.Client 3.6.0 supports:
      - net45 (.NETFramework,Version=v4.5)
      - netcore45 (.NETCore,Version=v4.5)
    One or more packages are incompatible with .NETCoreApp,Version=v1.0.

I think this happen just because of the bad metadata information on the nuspec.

I run out of time for today, so if @zidad can try fix the nuspec by pushing some commit on #589, I can push the new packages on MyGet (Wiebe you can also do it if you login on github with enq-bot and then login on myget using github provider)

Seems like RabbitMQ.Client dependency has not been updated. New package still depends on 3.6.0, but "core" version is 4.0.0

@thtp RabbitMQ.Client 4.0 hasn't been released yet. The latest released version is still 3.6.5, but we could decide to start working with 4.0 RC1 in a different branch. At least it's on nuget now so that's progress, didn't see that before...

I thought those MyGet package is "experimental" package, built on unstable branch to be something like prerelease version for core. So that prerelease package could depend on prerelease RabbitMQ.

Could you please publish to your MyGet feed prerelease version for .net core (netcoreapp1.0), built on prerelease version of RabbitMQ.Client (4.0.0-rc-1). You can call that version "*-develop" or even create separate package "EasyNetQ.Core", but it would be really great to have something to work with.

Could you please publish to your MyGet feed prerelease version for .net core (netcoreapp1.0), built on prerelease version of RabbitMQ.Client (4.0.0-rc-1). You can call that version "*-develop" or even create separate package "EasyNetQ.Core", but it would be really great to have something to work with.

@thtp as soon as we fixed the build, we will push a pre-release package on myget, we are also changing our branching style, so it needs some time

@thtp It should be easy to build it your own from this branch: https://github.com/zidad/EasyNetQ/tree/radicalgeek-netcore
just run build.cmd in ./EasyNetQ.Core and you should get a package, just deploy it to your own nuget repo...

@thtp I pushed a working ENQ netcore package on myget: easynetq 2.0.2-netcore0001

https://www.myget.org/F/easynetq-unstable/api/v3/index.json

@micdenny Great, thanks a lot! Testing it already.

Is there any update to the progress of netcore compatibility?

I'm little be stuck at work, but I hope to push some more commit in the next 2 weeks.

@jchannon have you (or anyone else) tried the version on myget? I'd be interested in your experiences. @micdenny do you think it's stable enough for a pre-release version on nuget.org?

@zidad
I agree with you.
Actually, the .NET Core is not a stable version by now even it has been released 1.0 .
To me, I've tried much more time on it BUT I still can't find out a way to run my code on the .NET Core platform. It is really difficult to use now. So that's why I understood many of famous 3rd supports has not started to use it.

do you think it's stable enough for a pre-release version on nuget.org?

@zidad sorry but to now is far from be acceptable to be used, because it lacks of connection configuration, and other TODOs that has to be manage before we can say we have a functional pre-release version, is for this reason that at the moment I'm pushing pre-release, let's say nightly build, on myget instead of nuget, because it is not really functional, for instance the bus now works only on a localhost rabbitmq instance, you cannot configure it, because we have to code the configuration in netcore way:

rabbitConnectionString = "host=localhost"; // TODO: get from configuration in net core 

it only works for the netfx package, but there's quite more netcore TODOs we have to fix, not so many, but I need a little bit more time, actually the main parts are (for the todo list check the issue description).

Hey @micdenny, I started a branch for the XUnit migration here. I'm curious how best to track this thing, how to request help (since it's a lot), and what to do about a few things (Rhino mocks issues, Integration/one-off test categorization). I didn't see a CONTRIBUTING.md or anything in the project.

@DustinVenegas aweseome! Regarding those issues, do you have a proposal on how to solve it? as I wouldn't know as I haven't tried it yet...

@zidad, I need the core team to comment on it. Would it be easier to open a PR for this?

Essentially, running Rhino Mocks returns some interesting results in the debug output. Test categorization needs to be triage since there's a lot of "run this when I explicitly say so" attributes.

I need someone familiar with the project to tell me about that Rhino output and come up with the test "groups" we'll need (e.g., RabbitMQLocalhost, Linux, etc).

I started a branch for the XUnit migration here. I'm curious how best to track this thing

in this case, to help us continue on this, you should start a branch not from master but from feature/netcore then start implementing unit test with xunit, also converting the project in net core (for this step you can look at this PR EasyNetQ/EasyNetQ.Management.Client#38)

after you did some changes on your local branch, you can start a new PR against feature/netcore and then we can help you on that, if the progress are ok to be merged at least on netcore branch, we merge, and continue on that feature branch. (be sure to always rebase your local branch before requesting a PR)

@micdenny thanks for pushing something out to https://www.myget.org/F/easynetq-unstable/api/v3/index.json, sorry that I have just had a time to come back to this.

Is that feed still what I should use? I am about to give it a go right now with a simple sample.

@micdenny I have gave it a go and I am getting the below exception on a sample which was working on mono:

rabbitsample             | 
rabbitsample             | Unhandled Exception: System.AggregateException: One or more errors occurred. (The operation requested on PersistentChannel timed out.) (The operation requested on PersistentChannel timed out.) ---> System.TimeoutException: The operation requested on PersistentChannel timed out.
rabbitsample             |    at EasyNetQ.Producer.ClientCommandDispatcherSingleton.Invoke(Action`1 channelAction)
rabbitsample             |    at EasyNetQ.RabbitAdvancedBus.ExchangeDeclare(String name, String type, Boolean passive, Boolean durable, Boolean autoDelete, Boolean internal, String alternateExchange, Boolean delayed)
rabbitsample             |    at EasyNetQ.Producer.PublishExchangeDeclareStrategy.DeclareExchange(IAdvancedBus advancedBus, String exchangeName, String exchangeType)
rabbitsample             |    at EasyNetQ.RabbitBus.Publish[T](T message, Action`1 configure)
rabbitsample             |    at rabbitsample.Publisher.<Start>b__2_0()
rabbitsample             |    at System.Threading.Tasks.Task`1.InnerInvoke()
rabbitsample             |    at System.Threading.Tasks.Task.Execute()
rabbitsample             |    --- End of inner exception stack trace ---
rabbitsample             |    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
rabbitsample             |    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
rabbitsample             |    at System.Threading.Tasks.Task.Wait()
rabbitsample             |    at rabbitsample.Program.Main(String[] args)
rabbitsample exited with code 134

Sample is available here and can be ran through docker-compose up.

@tugberkugurlu thank you for this good sample, I would wait for next pre-release that hat will be more stable, and then test again.

BTW I love the docker way :)

@tugberkugurlu I've tested your sample on docker and it seems working fine:

image

@tugberkugurlu ops, I've checked out the wrong branch/revision 😄

@tugberkugurlu it works even if I checkout the right revision 380ffa5161 that include EasyNetQ

image

Hi @micdenny ,
I would like to help with porting EasyNetQ to core. I have opened PR #630 to move EasyNetQ.Tests to core.

@micdenny

the bus now works only on a localhost rabbitmq instance, you cannot configure it, because we have to code the configuration in netcore

Do you plan to keep on .NET Core the API that looks in the configuration for the connection string ?
public static IBus CreateBus(AdvancedBusEventHandlers advancedBusEventHandlers, Action<IServiceRegister> registerServices)
The user can take care of their configuration and pass in the connection string when creating the bus.
If you plan to keep this functionality, in what file will the user be expected to put the connection string?

I opened a PR to remove on Core the CreateBus APIs that look into config files for the connection string. #633

@zidad @micdenny Do you think EasyNetQ for core is ready for a prerelease package? It looks like this item:

  1. fix the code on EasyNetQ to be netcore compatible

is complete, there is no work remaining with regard to .NET Core porting, and all tests pass.

I'm in favor of publishing a pre-release package, however I don't have access to the build server or nuget. I'll ping @micdenny to see if I can get access....

Thank you so much for your help @alinapopa!

I've just pushed a new version to the myget feed. @micdenny and I agreed we should test first from there before pushing to nuget.

Everyone watching in this thread, please check out the new build if it works for you. Thanks!

To update run:
update-package easynetq -pre -source https://www.myget.org/F/easynetq-unstable/api/v2 -version 2.0.3-netcore0001

Any updates on this? Just wanting to check where it might be at.

I'm having hard times, but I will try to come back on this in a couple of weeks and close it, sorry guys for delaying so much on easynetq.

@micdenny AFAIC we can really release the current version to nuget. I've used these packages for a while (on full .NET, .NET core not too much), and they work fine. GO! :)

ok I would like to push a v1 for the old version, and v2 for the new net/netcore

Greetings!

I am working on a project that has a dependency on EasyNetQ. I have been following your progress on supporting .NET Core for the last 6 months and it seems like you re further along now towards supporting it? I see your .NET Core feature branch is now merged with your dev branch.

No pressure but I just wanted to get a gauge on your timing for making a .NET Core release or even just a first beta release. Are you far along enough now to be able to articulate some ballpark releases? Weeks or months away? 6 months or more?

Hi @gruberchris .

The develop branch now deploys beta versions to nuget, if you would be so kind to try this version on nuget and give us feedback on your experiences that would be really helpful in getting a stable release out:

https://www.nuget.org/packages/EasyNetQ/2.0.3-unstable0057

Thank you in advance!

Wiebe

Just wanted to drop by and say that I've been developing and testing against 2.0.3-unstable0057 for the last month with no issues on .net core. Looking forward to a stable release hopefully soon!

@GreenGuy09 thanks a lot for the feedback! Can I ask you which platforms (.NET Core/Standard) version(s) you're targeting?

.NET Standard 1.6 for my libraries and .NET Core 1.1 for my apps.

thanks!

@zidad I've been using EasyNetQ on .NET Core for 5 months (previously on .NET Core 1.0, now on 1.1) and never had any problems.

Yeah I think we're good to do a stable release. Just 1 unit test that hasn't been rewritten yet and is currently being ignored, @micdenny anything on your wish list? (Other than the assembly versioning replacement)?

Probably the convertion to vs2017 before the first stable release just because the tooling we are using is not supported anymore

All,

Has there been any update on when this will make it into a stable release?

I'll try to pick up the conversion to VS2017 this week

I see the tooling got merged in - what does that mean for the stable core release?

@mccbraxton I'm not 100% sure about the RPC implementation. Is anyone willing to test if this works as expected with the latest alpha version? @Pliner @micdenny

Hey Everyone, first of all I want to say thank you for all of your hard work. How close is the project to being able to support .Net Core? Any estimate of when a .Net Core release might be available? Thank you!

as far as I'm concerned we're good to go. I've been running with this version for a while, but I'd like to hear a go from @micdenny and @Pliner too. Also I'm not 100% sure about the RPC implementation as I don't use that, so if anyone else could confirm that would be nice.

I'm blocked on easynetq for a while because I'm finishing a big project, so I'm also stuck to an old easynetq version, but from august I should have time to take the latest version and give it a try on production.

In the meanwhile if you would like to push it as stable, it's ok for me, a lot of people are requesting, and no complain has been received for a while, no one else is scared, so I would push it if the project has been converted to vs2017 and the build server has no problem compile it.

I would not push the project to stable if we still on the old netcore pre-release tools, because they are deprecated, I know they are only tools, but I would prefer to go on vs2017 even if the tools are worst than the pre-release ones, but at least they are supported and developed.

@micdenny yeah we're good for VS2017 and the build server.

OK, I've merged develop to master, creating the first stable 2.x release, 2.0.4:
https://www.nuget.org/packages/EasyNetQ

Hope all works well, any input appreciated!

the porting has been completed on version 2.x

thank you to all!!!