This commit is contained in:
Chris Cheetham 2021-06-25 07:57:47 -04:00
Родитель 5dc183d11d
Коммит 30c2e26860
3 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -13,9 +13,6 @@ namespace RabbitMQWeb
public static IHostBuilder CreateHostBuilder(string[] args) =>
RabbitHost.CreateDefaultBuilder()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
}
}
}

Просмотреть файл

@ -4,36 +4,25 @@ using Steeltoe.Messaging.RabbitMQ.Attributes;
namespace RabbitMQWeb.Services
{
/// <summary>
/// A service class that will handle incoming messages
/// </summary>
public class RabbitListener
{
private ILogger _logger;
public RabbitListener(ILogger<RabbitListener> logger)
{
_logger = logger;
}
/// <summary>
/// Process any messages put on the INFERRED_FOO_QUEUE
/// </summary>
/// <param name="rabbitMessage"></param>
[RabbitListener(Queues.InferredRabbitQueue)]
public void ListenForAFoo(RabbitMessage rabbitMessage)
{
_logger.LogInformation("Expected a Foo, got a {Message}", rabbitMessage);
}
/// <summary>
/// Process any messages put on the INFERRED_BAR_QUEUE
/// </summary>
/// <param name="longEaredRabbitMessage"></param>
[RabbitListener(Queues.InferredLongEaredRabbitQueue)]
public void ListenForAFoo(LongEaredRabbitMessage longEaredRabbitMessage)
{
_logger.LogInformation("Expected a Bar, got a {Message}", longEaredRabbitMessage);
}
}
}
}

Просмотреть файл

@ -47,10 +47,7 @@ namespace RabbitMQWeb
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}
}
}
}