зеркало из https://github.com/SteeltoeOSS/Samples.git
General tidying
This commit is contained in:
Родитель
5dc183d11d
Коммит
30c2e26860
|
@ -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(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче