public void Run()
        {
            if (!Configure.Instance.IsTimeoutManagerEnabled())
            {
                return;
            }

            timeoutPersisterReceiver = new TimeoutPersisterReceiver(Builder.Build<IManageTimeouts>());
            timeoutPersisterReceiver.MessageSender = MessageSender;
            timeoutPersisterReceiver.TimeoutsPersister = TimeoutsPersister;
            timeoutPersisterReceiver.Start();

            inputTransport = new TransactionalTransport
                {
                    MessageReceiver =
                        TimeoutMessageProcessor.MessageReceiverFactory != null
                            ? TimeoutMessageProcessor.MessageReceiverFactory()
                            : new MsmqMessageReceiver(),
                    IsTransactional = true,
                    NumberOfWorkerThreads =
                        MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
                    MaxRetries = MainTransport.MaxRetries,
                    FailureManager = new ManageMessageFailuresWithoutSlr(MainTransport.FailureManager),
                };

            inputTransport.TransportMessageReceived += OnTransportMessageReceived;

            inputTransport.Start(TimeoutDispatcherAddress);
        }
Ejemplo n.º 2
0
        public void Run()
        {
            if (!Configure.Instance.IsTimeoutManagerEnabled())
            {
                return;
            }

            timeoutPersisterReceiver = new TimeoutPersisterReceiver(Builder.Build <IManageTimeouts>());
            timeoutPersisterReceiver.MessageSender     = MessageSender;
            timeoutPersisterReceiver.TimeoutsPersister = TimeoutsPersister;
            timeoutPersisterReceiver.Start();

            inputTransport = new TransactionalTransport
            {
                MessageReceiver =
                    TimeoutMessageProcessor.MessageReceiverFactory != null
                            ? TimeoutMessageProcessor.MessageReceiverFactory()
                            : new MsmqMessageReceiver(),
                IsTransactional       = true,
                NumberOfWorkerThreads =
                    MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
                MaxRetries     = MainTransport.MaxRetries,
                FailureManager = new ManageMessageFailuresWithoutSlr(MainTransport.FailureManager),
            };

            inputTransport.TransportMessageReceived += OnTransportMessageReceived;

            inputTransport.Start(TimeoutDispatcherAddress);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            persister = CreateTimeoutPersister();
            messageSender = new FakeMessageSender();

            manager = new DefaultTimeoutManager
                {
                    TimeoutsPersister = persister,
                    MessageSender = messageSender,
                };

            receiver = new TimeoutPersisterReceiver
                {
                    TimeoutManager = manager,
                    TimeoutsPersister = persister,
                    MessageSender = messageSender,
                    SecondsToSleepBetweenPolls = 1,
                };
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            Address.InitializeLocalAddress("MyEndpoint");

            Configure.GetEndpointNameAction = () => "MyEndpoint";

            persister = CreateTimeoutPersister();
            messageSender = new FakeMessageSender();

            manager = new DefaultTimeoutManager
                {
                    TimeoutsPersister = persister,
                    MessageSender = messageSender,
                };

            receiver = new TimeoutPersisterReceiver
                {
                    TimeoutManager = manager,
                    TimeoutsPersister = persister,
                    MessageSender = messageSender,
                    SecondsToSleepBetweenPolls = 1,
                };
        }
Ejemplo n.º 5
0
 public void Stop()
 {
     TimeoutPersisterReceiver.Stop();
 }