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);
        }
Esempio 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);
        }
        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,
                };
        }
        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,
                };
        }
Esempio n. 5
0
 public void Stop()
 {
     TimeoutPersisterReceiver.Stop();
 }