public void SetUp() { userService = MockRepository.GenerateStub <IUserService> (); bus = MockRepository.GenerateStub <EasyNetQ.IBus> (); dateService = MockRepository.GenerateStub <IDateService> (); userModule = new UserModule(userService, bus, dateService); }
public EventBus(IBusLogger busLogger, IEventHandlerFactory eventHandlerFactory = null, EasyNetQ.IBus bus = null) { _eventHandlerFactory = eventHandlerFactory; _bus = bus; _busLogger = busLogger; }
public ActionStation(IBusLogger busLogger, IContainer container = null, IActionHandlerFactory ActionHandlerFactory = null, EasyNetQ.IBus bus = null) { _container = container; _actionHandlerFactory = ActionHandlerFactory; _bus = bus; _busLogger = busLogger; }
public ActiveProducer(IConnection amqConnection, ISession amqSession, String amqQueueName, EasyNetQ.IBus rabbitBus) { _rabbitBus = rabbitBus; ActiveMQQueue topic = new ActiveMQQueue(amqQueueName); _amqProducer = amqSession.CreateProducer(topic); countOfMessages = 0; _timProducer = new Timer(2000); _timProducer.Elapsed += _timProducer_Elapsed; _timProducer.Enabled = true; log.Info("Producer Connected to Queue '" + amqQueueName + "'"); }
public static void BootStrap() { var adapter = new EasyNetQ.DI.AutofacAdapter(new ContainerBuilder()); Container = adapter.Container; EasyNetQ.RabbitHutch.SetContainerFactory(() => { return adapter; }); EasyNetQBus = EasyNetQ.RabbitHutch.CreateBus(ConfigurationManager.ConnectionStrings["RabbitMq"].ConnectionString, x => x.Register<EasyNetQ.IEasyNetQLogger, NullLogger>()); _builder = new ContainerBuilder(); BindFrameworkObjects(); BindBusinessObjects(); BindValidators(); _builder.Update(Container); }
public ActiveConsumer(IConnection amqConnection, ISession amqSession, String amqQueueName, EasyNetQ.IBus rabbitBus) { try { _rabbitBus = rabbitBus; ActiveMQQueue topic = new ActiveMQQueue(amqQueueName); _amqConsumer = amqSession.CreateConsumer(topic); _amqConsumer.Listener +=_amqConsumer_Listener; _rabbitBus.Subscribe<CorpMessage>(amqQueueName, _rabbitMQConsumer_Listener); log.Info("Consumer Connected to Queue '" + amqQueueName + "'"); } catch(Exception e) { log.Info(e.ToString()); log.Debug(e.ToString()); } finally { } }
private void Form1_Load(object sender, EventArgs e) { try { IConnectionFactory factory = new ConnectionFactory(Properties.Settings.Default.MessageHost + ":" + Properties.Settings.Default.MessageHostPort); _amqconnection = factory.CreateConnection(); _amqconnection.ClientId = ProcessFiles.Properties.Settings.Default.MessageQueueName + ".NET"; _amqconnection.Start(); _amqsession = _amqconnection.CreateSession(); log.Debug("ActiveMQ Session Created."); _rabbitBus = EasyNetQ.RabbitHutch.CreateBus("host=localhost:5672"); log.Debug("RabbitMQ Session Created."); //_rabbitBus = EasyNetQ.RabbitHutch.CreateBus("localhost", 5672, // Properties.Settings.Default.MessageQueueName, "guest", "guest", 10, // x => x.Register<EasyNetQ.IEasyNetQLogger>(_ => new EasyNetLogger())); } catch (Exception ex) { throw; } }
public Bus(EasyNetQ.IBus bus) { RabbitMQBus = bus; }
public ActionBus(IBusLogger busLogger, EasyNetQ.IBus bus = null) { _bus = bus; _busLogger = busLogger; }
protected override void DisposeImpl() { base.DisposeImpl(); _bus.Dispose(); _bus = null; }
protected override void StopImpl() { base.StopImpl(); _bus.Dispose(); _bus = null; }
protected override void StartImpl() { base.StartImpl(); _bus = RabbitHutch.CreateBus(this.ConnectionString); }