Ejemplo n.º 1
0
 public ReceiveRampUpController(Action rampUpCallback, TransportNotifications transportNotifications, string queueName, int maximumConsecutiveFailures, int minimumConsecutiveSuccesses)
 {
     this.rampUpCallback         = rampUpCallback;
     this.transportNotifications = transportNotifications;
     this.queueName = queueName;
     this.maximumConsecutiveFailures  = maximumConsecutiveFailures;
     this.minimumConsecutiveSuccesses = minimumConsecutiveSuccesses;
 }
Ejemplo n.º 2
0
 public AdaptivePollingReceiver(
     IReceiveStrategy receiveStrategy,
     TableBasedQueue queue,
     Action <TransportMessage, Exception> endProcessMessage,
     RepeatedFailuresOverTimeCircuitBreaker circuitBreaker,
     TransportNotifications transportNotifications)
     : base(circuitBreaker)
 {
     this.receiveStrategy        = receiveStrategy;
     this.queue                  = queue;
     this.endProcessMessage      = endProcessMessage;
     this.transportNotifications = transportNotifications;
 }
 public AdaptivePollingReceiver(
     IReceiveStrategy receiveStrategy,
     TableBasedQueue queue,
     Action <TransportMessage, Exception> endProcessMessage,
     RepeatedFailuresOverTimeCircuitBreaker circuitBreaker,
     TransportNotifications transportNotifications)
     : base(queue.ToString(), circuitBreaker, transportNotifications, TimeSpan.FromMilliseconds(SlowTaskThresholdInMilliseconds))
 {
     this.receiveStrategy        = receiveStrategy;
     this.queue                  = queue;
     this.endProcessMessage      = endProcessMessage;
     this.transportNotifications = transportNotifications;
 }
 public SqlServerPollingDequeueStrategy(
     LocalConnectionParams locaConnectionParams,
     ReceiveStrategyFactory receiveStrategyFactory, 
     IQueuePurger queuePurger, 
     SecondaryReceiveConfiguration secondaryReceiveConfiguration,
     TransportNotifications transportNotifications, 
     RepeatedFailuresOverTimeCircuitBreaker circuitBreaker)
 {
     this.locaConnectionParams = locaConnectionParams;
     this.receiveStrategyFactory = receiveStrategyFactory;
     this.queuePurger = queuePurger;
     this.secondaryReceiveConfiguration = secondaryReceiveConfiguration;
     this.transportNotifications = transportNotifications;
     this.circuitBreaker = circuitBreaker;
 }
 public SqlServerPollingDequeueStrategy(
     LocalConnectionParams locaConnectionParams,
     ReceiveStrategyFactory receiveStrategyFactory,
     IQueuePurger queuePurger,
     SecondaryReceiveConfiguration secondaryReceiveConfiguration,
     TransportNotifications transportNotifications,
     RepeatedFailuresOverTimeCircuitBreaker circuitBreaker)
 {
     this.locaConnectionParams          = locaConnectionParams;
     this.receiveStrategyFactory        = receiveStrategyFactory;
     this.queuePurger                   = queuePurger;
     this.secondaryReceiveConfiguration = secondaryReceiveConfiguration;
     this.transportNotifications        = transportNotifications;
     this.circuitBreaker                = circuitBreaker;
 }
        public RealSimulator(string address, string connectionString)
        {
            this.address = address;
            var localConnectionParams = new LocalConnectionParams(null, connectionString, "dbo");
            new SqlServerQueueCreator(new DefaultConnectionStringProvider(localConnectionParams), ConnectionFactory.Default()).CreateQueueIfNecessary(Address.Parse(address), null);

            var transportNotifications = new TransportNotifications();

            taskStarted = transportNotifications.ReceiveTaskStarted.Subscribe(x => AddMessage("Thread started"));
            taskEnded = transportNotifications.ReceiveTaskStopped.Subscribe(x => AddMessage("Thread died"));

            dequeueStrategy = new SqlServerPollingDequeueStrategy(localConnectionParams,
                new ReceiveStrategyFactory(new DummyConnectionStore(), localConnectionParams, Address.Parse("error"), ConnectionFactory.Default()),
                new QueuePurger(new SecondaryReceiveConfiguration(_ => SecondaryReceiveSettings.Disabled()), localConnectionParams, ConnectionFactory.Default()), 
                new SecondaryReceiveConfiguration(_ => SecondaryReceiveSettings.Disabled()),
                transportNotifications,
                new RepeatedFailuresOverTimeCircuitBreaker("A", TimeSpan.FromDays(1000), _ => { }));

            dequeueStrategy.Init(Address.Parse(address), new TransactionSettings(true, TimeSpan.FromMinutes(2), System.Transactions.IsolationLevel.ReadCommitted, 1, false, false),
                ProcessMessage, (message, exception) => { });

            sender = new SqlServerMessageSender(new DefaultConnectionStringProvider(localConnectionParams), new DummyConnectionStore(), new DummyCallbackAddressStore(), ConnectionFactory.Default());
        }
Ejemplo n.º 7
0
 public ReceiveRampUpController(Action rampUpCallback, TransportNotifications transportNotifications, string queueName)
 {
     this.rampUpCallback         = rampUpCallback;
     this.transportNotifications = transportNotifications;
     this.queueName = queueName;
 }
Ejemplo n.º 8
0
 public ReceiveTaskTracker(int maximumConcurrency, TransportNotifications transportNotifications, string queueName)
 {
     this.maximumConcurrency     = maximumConcurrency;
     this.transportNotifications = transportNotifications;
     this.queueName = queueName;
 }
 public ReceiveRampUpController(Action rampUpCallback, TransportNotifications transportNotifications, string queueName)
 {
     this.rampUpCallback = rampUpCallback;
     this.transportNotifications = transportNotifications;
     this.queueName = queueName;
 }
Ejemplo n.º 10
0
 protected AdaptiveExecutor(string name, RepeatedFailuresOverTimeCircuitBreaker circuitBreaker, TransportNotifications transportNotifications, TimeSpan slowTaskThreshold)
 {
     this.name                   = name;
     this.circuitBreaker         = circuitBreaker;
     this.transportNotifications = transportNotifications;
     this.slowTaskThreshold      = slowTaskThreshold;
 }
Ejemplo n.º 11
0
 public TaskTracker(int maximumConcurrency, TransportNotifications transportNotifications, string executorName)
 {
     this.maximumConcurrency     = maximumConcurrency;
     this.transportNotifications = transportNotifications;
     this.executorName           = executorName;
 }
 public ReceiveTaskTracker(int maximumConcurrency, TransportNotifications transportNotifications, string queueName)
 {
     this.maximumConcurrency = maximumConcurrency;
     this.transportNotifications = transportNotifications;
     this.queueName = queueName;
 }