public UsersController(IOptions <RabbitmqConfig> rabbitConfig,
                        ISendEndpointProvider sendEndpoint, IPublishEndpoint publish, FakeStore fakeStore)
 {
     _fakeStore       = fakeStore;
     _rabbitConfig    = rabbitConfig.Value;
     _sendEndpoint    = sendEndpoint;
     _publishEndPoint = publish;
 }
Esempio n. 2
0
        public void StartActivityMonitoring(RabbitmqConfig rabbitmqConfig)
        {
            _rabbitmqConfig = rabbitmqConfig;

            timer.Interval = 30000;
            timer.Elapsed += timer_Elapsed;
            timer.Start();
        }
 public SubscribeToCompanyConsumer(IOptions <RabbitmqConfig> rabbitConfig,
                                   ISendEndpointProvider sendEndpoint, IPublishEndpoint publish,
                                   FakeStore store)
 {
     _store           = store;
     _rabbitConfig    = rabbitConfig.Value;
     _sendEndpoint    = sendEndpoint;
     _publishEndPoint = publish;
 }
Esempio n. 4
0
        public Service()
        {
            try
            {
                _receitaServices = new ReceitaService(new ReceitasRepository());
                config           = (RabbitmqConfig)System.Configuration.ConfigurationManager.GetSection("RabbitmqConfig");

                InitializeComponent();
                eventLog1.WriteEntry("Iniciando o monitoramento.");
                Singleton.ExecuteProperty.Instance.EventLog = eventLog1;
            }
            catch (Exception ex)
            {
                eventLog1.WriteEntry(ex.Message);
            }
        }
Esempio n. 5
0
        static IBusControl ConfigureBus(IServiceProvider provider)
        {
            _appConfig = provider.GetRequiredService <IOptions <RabbitmqConfig> >().Value;

            var bus = Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                var host = cfg.Host(new Uri(_appConfig.Host), h =>
                {
                    h.Username(_appConfig.Username);
                    h.Password(_appConfig.Password);
                });

                cfg.ConfigureEndpoints(provider);
            });

            return(bus);
        }
Esempio n. 6
0
        static void Mainaa(string[] args)
        {
            UnityContainer container = new UnityContainer();

            IReceitaService _receitaServices = new ReceitaService(new ReceitasRepository());

            RabbitmqConfig config = (RabbitmqConfig)System.Configuration.ConfigurationManager.GetSection("RabbitmqConfig");

            //ReceitasThread t = new ReceitasThread(_receitaServices);
            //System.Threading.Thread fwt = new System.Threading.Thread(t.Start);
            //fwt.Start();


            ReceitasAutoThread rat = new ReceitasAutoThread(_receitaServices);

            System.Threading.Thread fwt3 = new System.Threading.Thread(rat.Start);
            fwt3.Start();

            while (true)
            {
            }
        }
Esempio n. 7
0
 public RabbitmqThread(RabbitmqConfig rabbitmqConfig)
 {
     this._rabbitmqConfig = rabbitmqConfig;
 }