Replace IReadOnlyBasicProperties, IAmqpHeader
generic type constraints in IChannel.BasicPublishAsync()
with a single interface constraint.
#1815
-
Is your feature request related to a problem? Please describe.Currently it is not possible to create unit tests for code that consumes the Since The only way that I'm aware of to make the code testable is to use our own copy implementation of the Describe the solution you'd likeDefine an interface type that implements both interfaces and use it as the constraint instead of having two constraints. Something like
ValueTask BasicPublishAsync<TProperties>(string exchange, string routingKey,
bool mandatory, TProperties basicProperties, ReadOnlyMemory<byte> body,
CancellationToken cancellationToken = default)
where TProperties : IProperties; Describe alternatives you've consideredAlternativelly make the EmptyBasicProperty.Empty type visible to the outside, by defining it as namespace RabbitMQ.Client
{
public static class EmptyBasicProperty
{
public static EmptyBasicProperty Empty => new RabbitMQ.Client.Impl.EmptyBasicProperty();
}
} Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Hello, thanks for using this library. If you could provide a pull request with what you need, that is backwards-compatible with the version 7 API, and includes tests, I'd be happy to include it with version 7.2.0 of this library. Thanks. In addition, I would be curious to see what you are trying to accomplish with the library as it now stands - one of the tests you are trying to write that doesn't work. |
Beta Was this translation helpful? Give feedback.
-
Hello @lukebakken. As for the second question, I'm working on updating an example project that I used on a previous job application. And I'm still using it as boilerplate project for other work. Specifically for this context, I have a service that sends a message to the default exchange informing other subscribed services when a forex rate has been updated. I'll be using the workaround or try finding alternatives for this as I was not able yet to fix my code after the latest major changes. |
Beta Was this translation helpful? Give feedback.
-
I took a few minutes to review that repository, as well as try to update to version 7.1.2 of this library. I'm not yet sold that any change needs to happen to this library. What I'm going to do is convert this issue to a discussion, where we can continue looking at your code. |
Beta Was this translation helpful? Give feedback.
-
Here's my $0.02... I don't see the point of tests like these: If you're going to test So, at this point, please provide a concrete example of what you can't accomplish using version 7.1.2 of this library. Let me know when your repo has the necessary changes. |
Beta Was this translation helpful? Give feedback.
-
After checking the documentation I can just send as null. I appreciate your time and my apologies to bother... |
Beta Was this translation helpful? Give feedback.
After checking the documentation I can just send as null.
I appreciate your time and my apologies to bother...
Best regards.