2020-04-08 15:48:56 +02:00
|
|
|
using OutputServiceTSDB.RabbitMQ;
|
|
|
|
using Sentry;
|
2020-04-08 13:57:31 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2020-04-08 15:48:56 +02:00
|
|
|
using Microsoft.Extensions.Logging;
|
2020-04-08 02:04:22 +02:00
|
|
|
namespace OutputServiceTSDB
|
|
|
|
{
|
|
|
|
public class Program
|
2020-04-08 00:30:58 +02:00
|
|
|
{
|
2020-04-08 02:04:22 +02:00
|
|
|
public static void Main(string[] args)
|
2020-04-08 00:30:58 +02:00
|
|
|
{
|
2020-04-08 15:48:56 +02:00
|
|
|
using (SentrySdk.Init("https://744f5d479bdb4478b386173b92d081ac@sentry.kmlabz.com/12"))
|
|
|
|
{
|
|
|
|
var serviceCollection = new ServiceCollection();
|
|
|
|
ConfigureServices(serviceCollection);
|
|
|
|
|
|
|
|
var serviceProvider = serviceCollection.BuildServiceProvider();
|
|
|
|
RabbitMQWorker rabbitMQWorker = serviceProvider.GetService<RabbitMQWorker>();
|
|
|
|
rabbitMQWorker.ProcessMessages();
|
|
|
|
}
|
2020-04-08 00:55:43 +02:00
|
|
|
}
|
2020-04-08 02:04:22 +02:00
|
|
|
|
2020-04-08 15:48:56 +02:00
|
|
|
private static void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddLogging(configure => configure.AddConsole())
|
|
|
|
.Configure<LoggerFilterOptions>(options => options.MinLevel = LogLevel.Information)
|
|
|
|
.AddTransient<RabbitMQWorker>();
|
|
|
|
}
|
2020-04-08 00:30:58 +02:00
|
|
|
}
|
2020-04-08 13:57:31 +02:00
|
|
|
}
|