BasicProperties no longer public in .NET library

1,876 views
Skip to first unread message

Peter Morlion

unread,
Oct 16, 2020, 3:39:12 AM10/16/20
to rabbitmq-users
I just want to be sure I'm not missing something. But in version 5.1.2 of the RabbitMQ.Client .NET package, I could construct a new instance of the BasicProperties class (in the RabbitMQ.Client.Framing namespace).
In version 6.0.0, this is no longer possible and I have to call the channel.CreateBasicProperties() method.
However, this (breaking) change isn't specified in the changelog anywhere. I'm not complaining, just want to be sure (because I need to mention it in a LinkedIn Learning course I'm making) and maybe it should be added to the changelog?

Thanks in advance.

Luke Bakken

unread,
Oct 16, 2020, 8:59:09 AM10/16/20
to rabbitmq-users
Hi Peter,

There were so many changes in 6.0 that some were bound to be missed. We would welcome a PR to update whatever documentation is not correct.

Please be sure to use the latest version of the library, 6.2.1 - https://www.nuget.org/packages/RabbitMQ.Client/6.2.1

Thanks,
Luke

Ivan Abragimovich

unread,
Jul 12, 2021, 6:17:09 PM7/12/21
to rabbitmq-users
Hey Luke,

Is there any particular reason for this change? Can it be reverted?

Let me put a little context here:
I am currently busy with the wrapper library for RabbitMQ.Client, and I am going to migrate it from 5.2.1 to 6.2.1.
Unfortunately is not easy to do for two primary reasons:
1. As was previously mentioned by Peter, BasicProperties class is now marked as internal "https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/client/impl/BasicProperties.cs#L36". Therefore for 3rd part developers like me, it is not possible anymore to easily created without the usage of reflection.
2. The first point could be still manageable, in a case when everywhere inside "RabbitMQ.Client" will rely on the interface of this class (IBasicProperties).  Unfortunately, there are two places where IBasicProperties interface explicitly is downcasted to the specific implementation of this interface(class BasicProperties). These places can be found here:

So, if this class has been marked as internal accidentally, I will be glad to provide PR for reverting this change back. Otherwise, and more preferable IMHO, it is better to remove the dependency of a specific class implementation inside of Model class and use methods of an interface only.

Best regards,
Ivan

Guise

unread,
Jul 14, 2021, 4:13:25 AM7/14/21
to rabbitmq-users
My 2¢ - I would also vote for the latter. BasicProperties is somewhat unusual in that it is simultaneously a low-level implementation detail at the wire protocol, and also a high level interface in the public API, therefore it makes sense to draw a line between the interface and the implementation.

Ilya Khaprov

unread,
Jul 15, 2021, 6:12:57 AM7/15/21
to rabbitmq-users
Hello,

Please feel free do the PR and assign me (deadtrickster) for the review.

Regards
Reply all
Reply to author
Forward
0 new messages