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
Invalid operation exception, when trying to auto subscribe to events when using Brokered transports #1837
Comments
The following code sets the However, the code here does not respect it: |
@andreasohlund @SimonCropp -- thoughts?? Proposed Fix How about? if (Feature.IsEnabled<MessageDrivenSubscriptions>() == false)
{
// We are dealing with a brokered transport wired for auto pub/sub.
SubscriptionManager.Subscribe(messageType, null);
return;
} and add the following check before if (Feature.IsEnabled<MessageDrivenSubscriptions>() == false)
{
// We are dealing with a brokered transport wired for auto pub/sub.
SubscriptionManager.Unsubscribe(messageType, null);
return;
} |
looks good to me. although can the code be
|
also. if |
@SimonCropp - I think not. Because for ActiveMQ and RabbitMQ, users don't need to specify any message mappings in the app.config. In which case, address.Count will be zero. |
@indualagarsamy agreed. but if someone has put some message mapping in the config, that will be ignored, shouldn't we tell them? |
So, if addresses.Count > 0, how about we log a warning, stating:
|
sounds good |
…pings in app.config. In the next version, we can try and warn the user much earlier, as soon as we detect that we have mappings for events as opposed to at Subscribe and Unsubscribe time.
… an injectable property on the UnicastBus.
When using brokered transports that offer support for centralized pub/sub like
RabbitMQ
andActiveMQ
, theEndpointMappings
to specify event subscriptions are not needed. However, without it, an InvalidOperation exception was being thrown.Steps to Repro
EndpointMessageMappings
in the unicast bus section for the subscriber.Workaround
Add the message mappings in app.config.
NOTE: This used to work in version
4.2
The text was updated successfully, but these errors were encountered: