public static void Main() { Log4NetLogger.Use(@"D:\code\net\Converge\log4net.xml"); var transportSettings = TransportSettings.UseRabbitMq("localhost"); var container = BootstrapContainer(transportSettings, "converge_centralmon"); var appSubscribers = new CompositeSubscriber(); //appSubscribers.RegisterSubscribers(container.GetAllInstances<IDisposableSubscriber>()); // Roll out a service actnig as the primary app grunks HostFactory.Run(c => { c.SetServiceName("ConvergeCMon"); c.SetDisplayName("Converge Central monitor"); c.SetDescription("Converge node activity monitor."); c.RunAsLocalSystem(); Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); c.Service<MonitorService>(s => { s.ConstructUsing(builder => container.GetInstance<MonitorService>()); s.WhenStarted(o => o.Start()); s.WhenStopped(o => o.Stop()); }); }); }
public MonitorService(IServiceBus bus, CompositeSubscriber subscribers) { this.bus = bus; this.subscribers = subscribers; }