前端:
1、优化消息排序逻辑 2、新增加载历史消息 3、修复已知问题 后端: 1、优化消息排序逻辑 2、增加用户信息缓存机制 3、修改日期类型为DateTimeOffset改善时区信息丢失问题 3、修复了已知问题 数据库: 1、新增SequenceId字段用于消息排序 2、新增ClientMsgId字段用于客户端消息回执
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
using IM_API.Application.EventHandlers.FriendAddHandler;
|
||||
using AutoMapper;
|
||||
using IM_API.Application.EventHandlers.FriendAddHandler;
|
||||
using IM_API.Application.EventHandlers.MessageCreatedHandler;
|
||||
using IM_API.Application.EventHandlers.RequestFriendHandler;
|
||||
using IM_API.Configs.Options;
|
||||
using MassTransit;
|
||||
using MySqlConnector;
|
||||
|
||||
namespace IM_API.Configs
|
||||
{
|
||||
public static class MQConfig
|
||||
{
|
||||
public static IServiceCollection AddRabbitMQ(this IServiceCollection services, RabbitMqOptions options)
|
||||
public static IServiceCollection AddRabbitMQ(this IServiceCollection services, RabbitMQOptions options)
|
||||
{
|
||||
services.AddMassTransit(x =>
|
||||
{
|
||||
@@ -17,7 +20,7 @@ namespace IM_API.Configs
|
||||
x.AddConsumer<FriendAddSignalRHandler>();
|
||||
x.AddConsumer<RequestFriendSignalRHandler>();
|
||||
x.AddConsumer<FriendAddConversationHandler>();
|
||||
|
||||
x.AddConsumer<MessageCreatedDbHandler>();
|
||||
x.UsingRabbitMq((ctx,cfg) =>
|
||||
{
|
||||
cfg.Host(options.Host, "/", h =>
|
||||
@@ -26,7 +29,15 @@ namespace IM_API.Configs
|
||||
h.Password(options.Password);
|
||||
});
|
||||
cfg.ConfigureEndpoints(ctx);
|
||||
});
|
||||
cfg.UseMessageRetry(r =>
|
||||
{
|
||||
r.Handle<IOException>();
|
||||
r.Handle<MySqlException>();
|
||||
r.Ignore<AutoMapperMappingException>();
|
||||
r.Exponential(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(2));
|
||||
});
|
||||
cfg.ConfigureEndpoints(ctx);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -34,11 +45,5 @@ namespace IM_API.Configs
|
||||
}
|
||||
}
|
||||
|
||||
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