MassTransit一个类同时消费多个消息

MassTransit一个类同时消费多个消息,同时实现多个事件的接口

public class UpdateCustomerConsumer :
    IConsumer,IConsumer
{
    public async Task Consume(ConsumeContext context)
    {
        await Console.Out.WriteLineAsync($"Updating customer: {context.Message.CustomerId}");

        // update the customer address
    }

//第二个

public async Task Consume(ConsumeContext context)
    {
        await Console.Out.WriteLineAsync($"CreateOrder dacong: {context.Message.CustomerId}");
    }

}

你可能感兴趣的:(RabbitMQ)