Ajuste MsUsuarios: Puerto RabbitMQ

This commit is contained in:
Luis M 2024-05-16 16:37:29 -05:00
parent 61e26e4578
commit c2348380a1
5 changed files with 22 additions and 7 deletions

View File

@ -7,13 +7,16 @@ namespace MSAdminUsuarios.Models
public string HostName { get; set; } = null!;
public string UserName { get; set; } = null!;
public string Password { get; set; } = null!;
public int Port { get; set; }
public override string ToString()
{
if(Debugger.IsAttached) {
if (Debugger.IsAttached)
{
return ($"HostName: {HostName},\n " +
$"UserName: {UserName},\n" +
$"Password: {Password}");
$"Password: {Password},\n" +
$"Port: {Port}");
}
return "";
}

View File

@ -67,7 +67,8 @@ builder.Services.AddSingleton<IConnection>(sp =>
{
HostName = config.HostName,
UserName = config.UserName,
Password = config.Password
Password = config.Password,
Port = config.Port,
};
return factory.CreateConnection();
});
@ -125,6 +126,11 @@ app.MapControllers();
#endregion
using (var scope = app.Services.CreateScope())
{
// Inicializar el canal - Crea lo necesario en Rabbit antes de subscribirse
var channel = scope.ServiceProvider.GetRequiredService<RabbitMQ.Client.IModel>();
}
// Start and Subscribe to RabbitMQ event
RabbitMQService.ListenForIntegrationEvents(projectName, builder);

View File

@ -20,10 +20,13 @@ namespace MSAdminUsuarios.Utils
public readonly struct MQueues
{
public static readonly string medico = "UsuarioMedico";
//AdminUsuarios
public static readonly string PerfilesPorUsuario = "PerfilesPorUsuario";
public static readonly string Usuarios = "Usuarios";
// Agenda
public static readonly string FirmaUsuario = $"{Usuarios}.Firma";
public static readonly string medico = "UsuarioMedico";
}
public class MsComunicadoresModel
@ -114,6 +117,7 @@ namespace MSAdminUsuarios.Utils
HostName = mqConfig.HostName,
UserName = mqConfig.UserName,
Password = mqConfig.Password,
Port = mqConfig.Port
};
IConnection connection = factory.CreateConnection();

View File

@ -2,10 +2,11 @@
"ConnectionStrings": {
"ConString": "user id=ADMIN;password=ITTASA2017;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=181.204.191.98)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROYECTOS)))"
},
"RabbitMQConfig": {
"RabbitMQConfig": {
"HostName": "localhost",
"UserName": "guest",
"Password": "guest"
"Password": "guest",
"Port": 5672
},
"Logging": {
"LogLevel": {

View File

@ -5,7 +5,8 @@
"RabbitMQConfig": {
"HostName": "localhost",
"UserName": "guest",
"Password": "guest"
"Password": "guest",
"Port": 5672
},
"Logging": {
"LogLevel": {