public NameServerController(NameServerSetting setting = null) { Setting = setting ?? new NameServerSetting(); ClusterManager = new ClusterManager(this); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); _socketRemotingServer = new SocketRemotingServer("EQueue.NameServer.RemotingServer", Setting.BindingAddress, Setting.SocketSetting); _service = new ConsoleEventHandlerService(); _service.RegisterClosingEventHandler(eventCode => { Shutdown(); }); _socketRemotingServer.RegisterConnectionEventListener(new BrokerConnectionEventListener(this)); RegisterRequestHandlers(); }
private BrokerController(BrokerSetting setting) { Setting = setting ?? new BrokerSetting(); _consumerManager = ObjectContainer.Resolve<ConsumerManager>(); _messageStore = ObjectContainer.Resolve<IMessageStore>(); _consumeOffsetStore = ObjectContainer.Resolve<IConsumeOffsetStore>(); _queueStore = ObjectContainer.Resolve<IQueueStore>(); _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>(); _chunkReadStatisticService = ObjectContainer.Resolve<IChunkStatisticService>(); _producerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ProducerRemotingServer", Setting.ProducerAddress, Setting.SocketSetting); _consumerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ConsumerRemotingServer", Setting.ConsumerAddress, Setting.SocketSetting); _adminSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.AdminRemotingServer", Setting.AdminAddress, Setting.SocketSetting); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); _consumerSocketRemotingServer.RegisterConnectionEventListener(new ConsumerConnectionEventListener(this)); RegisterRequestHandlers(); _service = new ConsoleEventHandlerService(); _service.RegisterClosingEventHandler(eventCode => { Shutdown(); }); }