rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.09k stars 586 forks source link

7.0 release checklist / misc items #1413

Closed lukebakken closed 1 week ago

lukebakken commented 1 year ago
lukebakken commented 1 year ago

@stebet what do you think of this item?

Mark all sync API methods as Obsolete. Version 8 of this lib could then be async-only.

stebet commented 1 year ago

@stebet what do you think of this item?

Mark all sync API methods as Obsolete. Version 8 of this lib could then be async-only.

All for it!

bangjiehan commented 12 months ago

Does we need QueueDeclarePassiveAsync too?

lukebakken commented 12 months ago

@bangjiehan -

Does we need QueueDeclarePassiveAsync too?

The QueueDeclareAsync method has a passive parameter. Set it to true, and you will do a passive declaration.

QueueDeclarePassive has always been a convenience method added to the API. I'll make a note to add it to version 7.

lukebakken commented 5 months ago

https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1589

Gladskih commented 5 months ago

Is there documentation for new API? Or at least some example.

lukebakken commented 5 months ago

@Gladskih there isn't too much of a difference between the old API and the new one, to be honest. If you need a reference, the best place at this time are the test applications and integration tests:

If you need further assistance, please start a discussion rather than commenting on an issue: https://github.com/rabbitmq/rabbitmq-dotnet-client/discussions

YarinOmesi commented 3 months ago

@bollhals just FYI, I have decided that version 7 should ship on July 12th. I'm releasing 7.0.0-rc.2 today.

Any news on the release date ?

lukebakken commented 3 months ago

@YarinOmesi - if you'd like to assist with the release of version 7, test out an RC and report back how it works in your environment.

lukebakken commented 3 months ago

@bollhals - thanks for your latest contribution (#1636). Anything else on your plate for version 7? I am going to release a new RC today.

bollhals commented 3 months ago

@bollhals - thanks for your latest contribution (#1636). Anything else on your plate for version 7? I am going to release a new RC today.

Yes maybe. I'm almost done working on removing the non async @workflow for e.g. IBasicConsumer / Consumedispatcher. ) As this is facing public api change, it might be beneficial to include in 7.O

lukebakken commented 3 months ago

@bollhals feel free to open a draft PR with the work you have already done for that.

bollhals commented 3 months ago

Will do once I have something that is buildable / testable.

Hawxy commented 3 months ago

if you'd like to assist with the release of version 7, test out an RC and report back how it works in your environment.

@lukebakken Just some feedback as a developer of Wolverine, I upgraded our vnext branch to v7 RC a few weeks ago and all of our tests are passing. RC2 was a bit broken for us, but RC3 onwards has been fine.

lukebakken commented 3 months ago

@Hawxy thank you!

danielmarbach commented 3 months ago

I noticed some of the channel extensions don't have cancellation token support. I sent in a PR https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1641

There seems to be also connection extensions that might require a cancellation token (the ones that don't accept a timespan but don't have a token yet)

danielmarbach commented 3 months ago

I have also noticed some API asymmetry, and I don't understand why that is the case.

BasicAck and Nack return ValueTask while BasicReject returns a Task and has to call AsTask on ModelSendAsync which makes we wonder whether this was deliberate or the client API hasn't been properly aligned where necessary?

lukebakken commented 3 months ago

@danielmarbach I'll wait on releasing version 7 since you're finding stuff to address. Plus, there is #1640 to deal with as well. Thank you!

danielmarbach commented 2 months ago

@lukebakken I was wondering if it would make sense to consistently use value task on the channel APIs

Currently it is a mix and that leads to different ripple effects of having to adjust the outer code depending on the method you call.

Technically the Value Task on the public API would leave room for future optimizations under the hood without having to break the API. I guess the tradeoff there is API consistency and room for future changes under the cover.

https://blog.marcgravell.com/2019/08/prefer-valuetask-to-task-always-and.html?m=1

Thoughts? @stebet @paulomorgado @bollhals

Hawxy commented 2 months ago

https://blog.marcgravell.com/2019/08/prefer-valuetask-to-task-always-and.html?m=1

Worth mentioning that this blog post is out of date. The value task pooling mentioned was a .NET 5 experiment & never shipped as it negatively impacted performance in some scenarios and is now opt-in via an attribute (you'd need to benchmark to see if anything benefits from it). The recommendation of using ValueTask by default to benefit from some magical future improvement is incorrect.

The general rule of thumb is:

danielmarbach commented 2 months ago

Just to clarify. By default I'm also in the deliberate usage of Value Task camp. I only brought this up because as a user of the API the mixed mode has consequences too and changing the return value is a breaking change

paulomorgado commented 2 months ago

I'll have to admit that I haven't delved myself into the benefits of using ValueTask/ValueTask<T>.

@mgravell might be able to shed some light in how he feels about it 5 years later.

There's also Understanding the Whys, Whats, and Whens of ValueTask, from @stephentoub.

ValueTask/ValueTask<T> is better than Task/Task<T> for synchronous completion but comes with a few limitations over Task/Task<T> like being awaitable only once and sync-over-async might not work as expected.

ValueTask/ValueTask<T> can be pooled by explicitly using a specific state machine builder.

I would look into .NET source code the gather insights on real usage, but there's probably not time for that.

ValueTask/ValueTask<T>, although feeling strange, might be more future-proof. But that's just a feeling at this time.

stebet commented 2 months ago

I'm in the prefer ValueTask camp as well. There was a good blog post about it here: https://blog.marcgravell.com/2019/08/prefer-valuetask-to-task-always-and.html?m=1

danielmarbach commented 2 months ago

Related to @Hawxy and my comments and the guidance shared

When adding abstract, virtual, or interface methods, you also need to consider whether these situations will exist for overrides/implementations of that method.

https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask/

is the type of nuanced discussion I also wanted to kick off here before the API is shipped.

lukebakken commented 2 months ago

@danielmarbach @stebet @paulomorgado @Hawxy please move the Task / ValueTask discussion here -

https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/1645

Thanks.

lukebakken commented 3 weeks ago