MassTransit-订阅Azure Service Bus上的所有故障事件 [英] MassTransit - subscribing to all fault events on Azure Service Bus

查看:123
本文介绍了MassTransit-订阅Azure Service Bus上的所有故障事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道此处但没有足够的代表发表评论并要求澄清.

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

我一直在尝试达到所接受答案所暗示的类似目的, Azure Service Bus 上的一项服务捕获了所有Fault事件,但看不到任何类型的Fault正在发布.

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.

这就是我的订阅方式:

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

FaultConsumerBase : IConsumer<Fault>所在的位置.
我可以在masstransit/fault/FaultEventSubscription下看到我的订户.

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

文档中,示例均为所有订户Fault<T> .
因此,

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

  1. MassTransit是否仍发布所有Fault事件,或者它始终是Fault<T>?
  2. 如果是,一个人如何订阅?如果不是,那么建议使用哪种模式来捕获服务总线上的所有已发布故障(仅一次)?
    例如,随着订阅新事件而不断更新的服务将是不可取的.
  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.

推荐答案

正如@ChrisPatterson在对我的问题的评论中提到的那样,这在ASB上不起作用,因为ASB不支持多态消息传递.

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.

这篇关于MassTransit-订阅Azure Service Bus上的所有故障事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆