예제 #1
0
        protected override void OnStart(string[] args)
        {
            log.Information("Car Service Started");
            var imageFileFolder       = ConfigurationManager.AppSettings["adapter:ImageFileFolder"];
            var imageFilenameTemplate = ConfigurationManager.AppSettings["adapter:ImageFilenameTemplate"];

            ocrService = new A2iACombinedTableService(ocrConfiguration);

            ProcessingService.OcrService            = ocrService;
            ProcessingService.ImageFilePath         = imageFileFolder;
            ProcessingService.ImageFileNameTemplate = imageFilenameTemplate;
            ProcessingService.Run();
        }
예제 #2
0
 void Connection_ConnectionShutdown(object source, ShutdownEventArgs reason)
 {
     consumer.ConnectionLost -= Connection_ConnectionShutdown;
     log.Debug("CarService: Connection lost to RabbitMQ Server due to {0}", reason.Cause);
     try
     {
         consumer.StopConsuming();
     }
     catch (Exception ex)
     {
         log.Warning(ex, "CarService: Shutting down old connection to allow new connection to replace it");
     }
     InitializeQueueConnection();
     ProcessingService.StartConsumer();
 }
예제 #3
0
 protected override void OnStop()
 {
     ProcessingService.Stop();
     ocrService.Dispose();
     Log.Information("Car Service Stopped");
 }