Exemplo n.º 1
0
        private static void initializeEventDispatcher()
        {
            string sqlConnectionString = "server=db;userid=jomaya;password=jomaya;database=jomaya-frontend;";

            var optionsBuilder = new DbContextOptionsBuilder <FrontEndContext>();

            optionsBuilder.UseMySQL(sqlConnectionString);
            _context = new FrontEndContext(optionsBuilder.Options);

            _klantRepo      = new KlantRepository(_context);
            _autoRepo       = new AutoRepository(_context);
            _onderhoudsRepo = new OnderhoudRepository(_context);

            var config = new EventBusConfig()
            {
                Host      = "rabbitmq",
                Port      = 5672,
                QueueName = "jomaya.frontend.auto.dispatcher"
            };

            var publisher = new EventPublisher(config);

            _autoDispatcher = new AutoDispatcher(config, _autoRepo, _onderhoudsRepo);

            config = new EventBusConfig()
            {
                Host      = "rabbitmq",
                Port      = 5672,
                QueueName = "jomaya.frontend.klant.dispatcher"
            };
            _klantDispatcher = new KlantDispatcher(config, _klantRepo);
        }
Exemplo n.º 2
0
 public Main(AppSetting setting, MouseClicker mover, CaseUpdater updater, DriverCreator creator, AutoDispatcher autoDispatcher, Context context)
 {
     _setting        = setting;
     _mover          = mover;
     _updater        = updater;
     _config         = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
     _creator        = creator;
     _autoDispatcher = autoDispatcher;
     _context        = context;
     _main           = this;
     InitializeComponent();
 }
Exemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppSetting     setting    = new AppSetting();
            MouseClicker   mover      = new MouseClicker();
            CaseUpdater    updater    = new CaseUpdater();
            DriverCreator  creator    = new DriverCreator();
            Context        context    = new Context();
            AutoDispatcher dispatcher = new AutoDispatcher(context);

            Application.Run(new Main(setting, mover, updater, creator, dispatcher, context));
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseIISIntegration()
                       .UseStartup <Startup>()
                       .Build();

            string sqlConnectionString = "server=db;userid=jomaya;password=jomaya;database=jomaya-autoservice;";

            _publisher = new EventPublisher(

                new EventBusConfig()
            {
                Host = "rabbitmq",
                Port = 5672,
            }
                );

            var optionsBuilder = new DbContextOptionsBuilder <AutosBackendContext>();

            optionsBuilder.UseMySQL(sqlConnectionString);
            _context = new AutosBackendContext(optionsBuilder.Options);

            _autoRepo      = new AutoRepository(_context);
            _onderhoudRepo = new OnderhoudRepository(_context);
            var config = new EventBusConfig()
            {
                Host      = "rabbitmq",
                Port      = 5672,
                QueueName = "jomaya.autoservice.auto.dispatcher"
            };

            var publisher = new EventPublisher(config);

            _autoDispatcher = new AutoDispatcher(config, new Services.AutoService(_autoRepo, _onderhoudRepo, _publisher));

            host.Run();
        }