Masstransit one fault consumer for all fault messa

2020-07-18 10:34发布

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

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

标签: masstransit
1条回答
\"骚年 ilove
2楼-- · 2020-07-18 11:21

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.

查看更多
登录 后发表回答