Example #1
0
        public QueueService(IMessageProducerScopeFactory messageProducerScopeFactory,
                            IMessageConsumerScopeFactory messageConsumerScopeFactory,
                            IAzureService azureService,
                            IProjectBuilder builder,
                            IFileArchiver fileArchiver,
                            ILogger <QueueService> logger)
        {
            _logger = logger;
            _logger.LogInformation("queue service start");
            _messageProducerScopeBuild = messageProducerScopeFactory.Open(new MessageScopeSettings
            {
                ExchangeName = "BuildServerExchangeBuild",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "BuildResultQueue",
                RoutingKey   = "buildResponse"
            });
            _messageProducerScopeRun = messageProducerScopeFactory.Open(new MessageScopeSettings
            {
                ExchangeName = "BuildServerExchangeRun",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "RunResultQueue",
                RoutingKey   = "runResponse"
            });

            _messageConsumerScopeRun = messageConsumerScopeFactory.Connect(new MessageScopeSettings
            {
                ExchangeName = "IdeExchangeRun",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "SendRunRequestQueue",
                RoutingKey   = "runRequest"
            });
            _messageConsumerScopeBuild = messageConsumerScopeFactory.Connect(new MessageScopeSettings
            {
                ExchangeName = "IdeExchangeBuild",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "SendBuildRequestQueue",
                RoutingKey   = "buildRequest"
            });

            _messageConsumerScopeBuild.MessageConsumer.Received += MessageConsumer_BuildReceived;
            _messageConsumerScopeRun.MessageConsumer.Received   += MessageConsumer_RunReceived;
            _worker = new Worker(builder, fileArchiver, azureService);
        }
Example #2
0
        public QueueService(IMessageProducerScopeFactory messageProducerScopeFactory,
                            IMessageConsumerScopeFactory messageConsumerScopeFactory,
                            ILogger <QueueService> logger)
        {
            _messageProducerScopeRun = messageProducerScopeFactory.Open(new MessageScopeSettings
            {
                ExchangeName = "IdeExchangeRun",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "SendRunRequestQueue",
                RoutingKey   = "runRequest"
            });
            _messageProducerScopeBuild = messageProducerScopeFactory.Open(new MessageScopeSettings
            {
                ExchangeName = "IdeExchangeBuild",
                ExchangeType = ExchangeType.Direct,
                QueueName    = "SendBuildRequestQueue",
                RoutingKey   = "buildRequest"
            });

            _logger = logger;
        }