-
Notifications
You must be signed in to change notification settings - Fork 606
Expose DispatchConsumersAsync as a readonly from ConnectionFactory to IConnection #1611
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
Conversation
@luizcarlosfaria Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@luizcarlosfaria Thank you for signing the Contributor License Agreement! |
Removing trailing lines
Thank you for taking the time to contribute. |
Hello and thanks for your contribution. Since version 7 should ship "soon", I'm hesitant to accept API changes. Please note that using the wrong combination of |
Great news, but instead, must be adding an inverse check to guarantee that if In my case, the only implementation of consumer is Async, but sometime, users do not configure The way to make consistence guarantee is requesting the user
The effect is that consumer never be called. |
Hi @luizcarlosfaria, I didn't realize you're using this library as part of a larger project that could benefit RabbitMQ users everywhere (https://github.com/luizcarlosfaria/Oragon.RabbitMQ). Let me re-visit this PR. I agree, the validation needs to be consistent. |
* Name new property `DispatchConsumersAsyncEnabled`. * Add a check on `BasicConsume` for when a regular dispatcher is used, and an async consumer passed.
* Name new property `DispatchConsumersAsyncEnabled`. * Add a check on `BasicConsume` for when a regular dispatcher is used, and an async consumer passed. * Test the new `DispatchConsumersAsyncEnabled` property.
I have taken the code in this PR and added to it here - #1615 |
…llowup Add `DispatchConsumersAsyncEnabled` property on `IConnection` (#1611)
Proposed Changes
Expose
DispatchConsumersAsync
property from internal_config.DispatchConsumersAsync
to a read only property onIConnection
interface, described in #1610.Creating a consumer that receive a
IConnection
from dependency injection, without touch onIConnectionFactory
, understand if connection will use async or sync dispatch is important to validate and help a developer to configureConnectionFactory
right.It will enable to create a validation that avoids starting a consumer who never dispatches messages to user code because the connection is defined with synchronous dispatch and consumer is asynchronous or vice versa.
Types of Changes
Promote a hidden property defined on constructor to expose as a part of IConnection Interface.
Checklist
CONTRIBUTING.md
document