Masstransit one fault consumer for all fault message

不羁岁月 提交于 2020-01-13 05:26:07

问题


How to have one generic consumer that handle all Fault Messages ?

Do I need to register Fault Consumer for each of my fault messages?


回答1:


Why not consume Fault?

public class WantAllFaultsGimmeThem : IConsumer<Fault>
{
    public async Task Consume(ConsumeContext<Fault> context)
    {
        // whatever you want to do here
    }
}

The only issue is that the Message is not part of this interface and therefore it will not be even deserialised. so you will not have access to the message, only to the message id.



来源:https://stackoverflow.com/questions/48623670/masstransit-one-fault-consumer-for-all-fault-message

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