Ejemplo n.º 1
0
        public void Configure()
        {
            _rabbitMqEndpoint.Initialize();

            var commandsExchangeName = RabbitMqExchangeNamesFactory.GetIntegrationCommandsExchangeName(_integrationName);
            var eventsExchangeName   = RabbitMqExchangeNamesFactory.GetIntegrationEventsExchangeName(_integrationName);

            _rabbitMqEndpoint.DeclareExchange(commandsExchangeName);
            _rabbitMqEndpoint.DeclareExchange(eventsExchangeName);

            var subscriptions = new MessageSubscriptionsRegistry()
                                .Handle <ReadBlockCommand>(o =>
            {
                o.WithHandler <ReadBlockCommandsHandler>();
            })
                                .AddFilter(new AppInsightTelemetryMessageFilter());

            _rabbitMqEndpoint.Subscribe(
                subscriptions,
                commandsExchangeName,
                $"bil-v2.bcn-{_integrationName}",
                messageConsumersCount: _rabbitMqSettings.MessageConsumersCount,
                messageProcessorsCount: _rabbitMqSettings.MessageProcessorsCount,
                defaultFirstLevelRetryTimeout: _rabbitMqSettings.DefaultFirstLevelRetryTimeout,
                maxFirstLevelRetryMessageAge: _rabbitMqSettings.MaxFirstLevelRetryMessageAge,
                maxFirstLevelRetryCount: _rabbitMqSettings.MaxFirstLevelRetryCount,
                firstLevelRetryQueueCapacity: _rabbitMqSettings.FirstLevelRetryQueueCapacity,
                processingQueueCapacity: _rabbitMqSettings.ProcessingQueueCapacity,
                replyExchangeName: eventsExchangeName);

            _rabbitMqEndpoint.StartListening();
        }
Ejemplo n.º 2
0
 public void StartListening()
 {
     _endpoint.StartListening();
 }