コード例 #1
0
        ReceiveTransportHandle IReceiveTransport.Start()
        {
            var queue = _context.MessageFabric.GetQueue(_queueName);

            IDeadLetterTransport deadLetterTransport = new InMemoryMessageDeadLetterTransport(_context.MessageFabric.GetExchange($"{_queueName}_skipped"));

            _context.AddOrUpdatePayload(() => deadLetterTransport, _ => deadLetterTransport);

            IErrorTransport errorTransport = new InMemoryMessageErrorTransport(_context.MessageFabric.GetExchange($"{_queueName}_error"));

            _context.AddOrUpdatePayload(() => errorTransport, _ => errorTransport);

            _context.ConfigureTopology();

            return(new ReceiveTransportAgent(_context, queue));
        }
コード例 #2
0
        public IReceiveTransport GetReceiveTransport(string queueName, ReceiveEndpointContext receiveEndpointContext)
        {
            LogContext.SetCurrentIfNull(_hostConfiguration.LogContext);

            TransportLogMessages.CreateReceiveTransport(receiveEndpointContext.InputAddress);

            var queue = _messageFabric.Value.GetQueue(queueName);

            IDeadLetterTransport deadLetterTransport = new InMemoryMessageDeadLetterTransport(_messageFabric.Value.GetExchange($"{queueName}_skipped"));

            receiveEndpointContext.GetOrAddPayload(() => deadLetterTransport);

            IErrorTransport errorTransport = new InMemoryMessageErrorTransport(_messageFabric.Value.GetExchange($"{queueName}_error"));

            receiveEndpointContext.GetOrAddPayload(() => errorTransport);

            var transport = new InMemoryReceiveTransport(new Uri(_hostConfiguration.HostAddress, queueName), queue, receiveEndpointContext);

            Add(transport);

            return(transport);
        }
コード例 #3
0
ファイル: InMemoryHost.cs プロジェクト: zz110/MassTransit
        public IReceiveTransport GetReceiveTransport(string queueName, ReceiveEndpointContext receiveEndpointContext)
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("Creating receive transport for queue: {0}", queueName);
            }

            var queue = _messageFabric.GetQueue(queueName);

            IDeadLetterTransport deadLetterTransport = new InMemoryMessageDeadLetterTransport(_messageFabric.GetExchange($"{queueName}_skipped"));

            receiveEndpointContext.GetOrAddPayload(() => deadLetterTransport);

            IErrorTransport errorTransport = new InMemoryMessageErrorTransport(_messageFabric.GetExchange($"{queueName}_error"));

            receiveEndpointContext.GetOrAddPayload(() => errorTransport);

            var transport = new InMemoryReceiveTransport(new Uri(_hostConfiguration.HostAddress, queueName), queue, receiveEndpointContext);

            Add(transport);

            return(transport);
        }