コード例 #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);
        }
コード例 #2
0
        public Wrapper(string exchangeNameForProducer, string queueNameForProducer, string routingKeyForProducer, string exchangeNameForConsumer, string queueNameForConsumer, string routingKeyForConsumer)
        {
            IMessageProducerScopeFactory messageProducerScopeFactory = new MessageProducerScopeFactory(Services.ConnectionFactory.MakeConection());

            _messageProducerScope = messageProducerScopeFactory.Open(new MessageScopeSettings
            {
                ExchangeName = exchangeNameForProducer,
                ExhangeType  = ExchangeType.Direct,
                QueueName    = queueNameForProducer,
                RoutingKey   = routingKeyForProducer
            });
            IMessageConsumerScopeFactory messageConsumerScopeFactory = new MessageConsumerScopeFactory(Services.ConnectionFactory.MakeConection());

            _messageConsumerScope = messageConsumerScopeFactory.Connect(new MessageScopeSettings
            {
                ExchangeName = exchangeNameForConsumer,
                ExhangeType  = ExchangeType.Direct,
                QueueName    = queueNameForConsumer,
                RoutingKey   = routingKeyForConsumer
            });
        }
コード例 #3
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;
        }