示例#1
0
 public HostService(MessageForwardingService messageForwardingService, IncommingMessageRepository messageRepository)
 {
     _messagesRepository = messageRepository;
     _messageForwardingService = messageForwardingService;
     new MessageCleanerService(ServiceEvents.Instance.Value, _messagesRepository);
     _webApiHost = new WebAPISelfHost(HostConfiguration.Instance.Value.WebListenerPort);
 }
示例#2
0
        public HostService()
        {
            var kafkaProducerFactory = new KafkaProducerFactory(KafkaConfiguration.FromLocalFile("KafkaConfiguration.json"));
            var forwarderFactory = new MessageForwarderFactory(
                new MomRepository(kafkaProducerFactory),
                ServiceEvents.Instance.Value,
                new QuotaFactory(HostConfiguration.Instance.Value)
            );

            _messagesRepository = new IncommingMessageRepository();
            _messageForwardingService = new MessageForwardingService(new JsonSerializer(), ServiceEvents.Instance.Value, forwarderFactory);
            new MessageCleanerService(ServiceEvents.Instance.Value, _messagesRepository);
            _webApiHost = new WebAPISelfHost(HostConfiguration.Instance.Value.WebListenerPort);
        }