后端:
1、事件订阅增加rabbitmq中间件 移动端: 1、完善移动端目录结构和代码框架
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using IM_API.Application.EventHandlers.FriendAddHandler;
|
||||
using IM_API.Application.EventHandlers.MessageCreatedHandler;
|
||||
using MassTransit;
|
||||
|
||||
namespace IM_API.Configs
|
||||
{
|
||||
public static class MQConfig
|
||||
{
|
||||
public static IServiceCollection AddRabbitMQ(this IServiceCollection services, RabbitMqOptions options)
|
||||
{
|
||||
services.AddMassTransit(x =>
|
||||
{
|
||||
x.AddConsumer<ConversationEventHandler>();
|
||||
x.AddConsumer<SignalREventHandler>();
|
||||
x.AddConsumer<FriendAddConversationHandler>();
|
||||
x.AddConsumer<FriendAddSignalRHandler>();
|
||||
|
||||
x.UsingRabbitMq((ctx,cfg) =>
|
||||
{
|
||||
cfg.Host(options.Host, "/", h =>
|
||||
{
|
||||
h.Username(options.Username);
|
||||
h.Password(options.Password);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
public class RabbitMqOptions
|
||||
{
|
||||
public string Host { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get;set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user