MassTransit - subscribing to all fault events on Azure Service Bus

冷暖自知 提交于 2019-12-25 03:21:26

问题


I'm aware of a similar post here but don't have enough rep to comment and ask for clarification.

I've been trying to achieve a similar thing as the accepted answer suggests, with one service on Azure Service Bus capturing all Fault events, but can't see any events of type Fault being published.

This is how I'm subscribed:

Bus.Factory.CreateUsingAzureServiceBus(
sbc =>
{
    var host = ConfigureServiceBus(serviceBusPath, sbc);
    sbc.SubscriptionEndpoint<Fault>(host, subscriptionName,
    ec => { ec.Consumer<FaultConsumerBase>(context); });
})

Where FaultConsumerBase : IConsumer<Fault>.
I can see my subscriber under masstransit/fault/FaultEventSubscription.

From the documentation, the examples are all of subscribers Fault<T>.
So,

  1. Does MassTransit still publish all Fault events, or will it always be Fault<T>?
  2. If yes, how does one subscribe to these? If no, what is the recommended pattern to catch all published Faults (just once) on the service bus?
    A service that is constantly updated with subscriptions to new events, for example, would be undesirable.

回答1:


As mentioned by @ChrisPatterson in comment to my quesiton, this is does not work on ASB due to the fact that ASB does not support polymorphic messaging.



来源:https://stackoverflow.com/questions/53050780/masstransit-subscribing-to-all-fault-events-on-azure-service-bus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!