public EventStoreBusPublisher(IServiceBus sender, IPendingEventsQueue <T> queue)
        {
            this._sender = sender;
            this._queue  = queue;

            _enqueuedKeys = new BlockingCollection <string>();
        }
        public EventStoreBusPublisher(IMessageSender sender, IPendingEventsQueue queue)
        {
            this.sender = sender;
            this.queue = queue;

            this.enqueuedKeys = new BlockingCollection<string>();
        }
Ejemplo n.º 3
0
        public EventStoreBusPublisher(IMessageSender sender, IPendingEventsQueue queue, IEventStoreBusPublisherInstrumentation instrumentation)
        {
            this.sender          = sender;
            this.queue           = queue;
            this.instrumentation = instrumentation;

            this.enqueuedKeys      = new BlockingCollection <string>();
            this.dynamicThrottling =
                new DynamicThrottling(
                    maxDegreeOfParallelism: 230,
                    minDegreeOfParallelism: 30,
                    penaltyAmount: 3,
                    workFailedPenaltyAmount: 10,
                    workCompletedParallelismGain: 1,
                    intervalForRestoringDegreeOfParallelism: 8000);
            this.queue.Retrying  += (s, e) => this.dynamicThrottling.Penalize();
            this.sender.Retrying += (s, e) => this.dynamicThrottling.Penalize();
        }
Ejemplo n.º 4
0
        public EventStoreBusPublisher(IMessageSender sender, IPendingEventsQueue queue, IEventStoreBusPublisherInstrumentation instrumentation)
        {
            this.sender          = sender;
            this.queue           = queue;
            this.instrumentation = instrumentation;

            enqueuedKeys      = new BlockingCollection <string>();
            dynamicThrottling =
                new DynamicThrottling(
                    230,
                    30,
                    3,
                    10,
                    1,
                    8000);
            this.queue.Retrying  += (s, e) => dynamicThrottling.Penalize();
            this.sender.Retrying += (s, e) => dynamicThrottling.Penalize();
        }