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

            controlTransport = new TransactionalTransport
            {
                IsTransactional       = true,
                FailureManager        = MessageFailureManager,
                MessageReceiver       = new MsmqMessageReceiver(),
                MaxRetries            = 5,
                NumberOfWorkerThreads = NumberOfWorkerThreads,
            };

            controlTransport.TransportMessageReceived +=
                (obj, ev) =>
            {
                var transportMessage = ev.Message;

                if (!transportMessage.IsControlMessage())
                {
                    return;
                }

                HandleControlMessage(transportMessage);
            };

            controlTransport.Start(ControlQueue);
        }
예제 #2
0
        public void Start()
        {
            var templateTransport = Configure.Instance.Builder.Build <TransactionalTransport>();

            transport = new TransactionalTransport
            {
                //todo grab the receiver from the main bus and clone
                MessageReceiver       = new MsmqMessageReceiver(),
                IsTransactional       = true,
                NumberOfWorkerThreads = templateTransport.NumberOfWorkerThreads == 0 ? 1 : templateTransport.NumberOfWorkerThreads,
                MaxRetries            = templateTransport.MaxRetries,
                FailureManager        = templateTransport.FailureManager
            };


            transport.TransportMessageReceived += (s, e) =>
            {
                var address = GetRemoteAddress(RemoteAddress, e.Message);

                channelSender.Send(e.Message, address);

                notifier.RaiseMessageForwarded(ChannelType.Msmq, ChannelType.Http, e.Message);

                //todo get audit settings from the audit settings of the host (possibly allowing to override in config)
                //if (!string.IsNullOrEmpty(audit))
                // messageSender.Send(e.Message, audit);
            };
            transport.Start(InputQueue);
        }
예제 #3
0
        public void Start()
        {
            var templateTransport = Configure.Instance.Builder.Build <TransactionalTransport>();

            transport = new TransactionalTransport
            {
                //todo grab the receiver from the main bus and clone
                MessageReceiver       = new MsmqMessageReceiver(),
                IsTransactional       = true,
                NumberOfWorkerThreads = templateTransport.NumberOfWorkerThreads == 0 ? 1 : templateTransport.NumberOfWorkerThreads,
                MaxRetries            = templateTransport.MaxRetries,
                FailureManager        = templateTransport.FailureManager
            };


            transport.TransportMessageReceived += (s, e) =>
            {
                var transportMessage = e.Message;

                var address = GetRemoteAddress(RemoteAddress, transportMessage);

                //todo - why are we doing this?
                if (!String.IsNullOrEmpty(transportMessage.IdForCorrelation))
                {
                    transportMessage.IdForCorrelation = transportMessage.Id;
                }

                var headers = new NameValueCollection();

                HeaderMapper.Map(transportMessage, headers);

                channelSender.Send(address, headers, transportMessage.Body);

                notifier.RaiseMessageForwarded(ChannelType.Msmq, channelSender.Type, transportMessage);

                //todo get audit settings from the audit settings of the host (possibly allowing to override in config)
                //if (!string.IsNullOrEmpty(audit))
                // messageSender.Send(e.Message, audit);
            };

            transport.Start(InputQueue);
        }
예제 #4
0
        public void Start(Address inputAddress)
        {
            localAddress        = inputAddress;
            addressOfAuditStore = settings.AddressOfAuditStore;

            transport = new TransactionalTransport
            {
                MessageReceiver       = settings.Receiver,
                IsTransactional       = true,
                NumberOfWorkerThreads = settings.NumberOfWorkerThreads,
                MaxRetries            = settings.MaxRetries,
                FailureManager        = settings.FailureManager
            };

            transport.TransportMessageReceived += OnTransportMessageReceived;

            transport.Start(localAddress);

            Logger.InfoFormat("Gateway started listening on inputs on - {0}", localAddress);
        }
예제 #5
0
        public void Run()
        {
            if (!ConfigureTimeoutManager.TimeoutManagerEnabled)
            {
                return;
            }

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

            inputTransport.TransportMessageReceived += OnTransportMessageReceived;

            inputTransport.Start(ConfigureTimeoutManager.TimeoutManagerAddress);
        }
        public void Start(string inputAddress)
        {
            localAddress = inputAddress;

            var templateTransport = Configure.Instance.Builder.Build <TransactionalTransport>();

            transport = new TransactionalTransport
            {
                //todo grab the receiver from the main bus and clone
                MessageReceiver       = new MsmqMessageReceiver(),
                IsTransactional       = true,
                NumberOfWorkerThreads = templateTransport.NumberOfWorkerThreads == 0 ? 1 : templateTransport.NumberOfWorkerThreads,
                MaxRetries            = templateTransport.MaxRetries,
                FailureManager        = templateTransport.FailureManager
            };

            transport.TransportMessageReceived += OnTransportMessageReceived;

            transport.Start(inputAddress);
        }
예제 #7
0
        public void Run()
        {
            if (!ConfigureTimeoutManager.TimeoutManagerEnabled)
            {
                return;
            }

            var messageReceiver = MessageReceiverFactory != null?MessageReceiverFactory() : new MsmqMessageReceiver();

            inputTransport = new TransactionalTransport
            {
                MessageReceiver       = messageReceiver,
                IsTransactional       = true,
                NumberOfWorkerThreads = MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
                MaxRetries            = MainTransport.MaxRetries,
                FailureManager        = Builder.Build(MainTransport.FailureManager.GetType()) as IManageMessageFailures
            };

            inputTransport.TransportMessageReceived += OnTransportMessageReceived;

            inputTransport.Start(ConfigureTimeoutManager.TimeoutManagerAddress);
        }