领域事件预备测试
This commit is contained in:
@@ -151,9 +151,20 @@ builder.Services.AddMediator(cfg =>
|
||||
cfg.AddConsumer<ConsistencyCheckConsumer>();
|
||||
});
|
||||
|
||||
// 添加 MassTransit 和 InMemory 传输
|
||||
builder.Services.AddMassTransit(cfg =>
|
||||
{
|
||||
cfg.UsingInMemory();
|
||||
// 注册消费者
|
||||
cfg.AddConsumer<AddSubjectConsumer>(); // 替换为你的消费者类
|
||||
|
||||
// 使用 InMemory 作为消息传递机制
|
||||
cfg.UsingInMemory((context, cfg) =>
|
||||
{
|
||||
// 这里可以进行额外的配置
|
||||
cfg.ConfigureEndpoints(context); // 自动配置所有消费者的端点
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user