public SqsReceiveEndpointContext CreateReceiveEndpointContext()
        {
            var brokerTopology = BuildTopology(_configuration.Settings);

            IDeadLetterTransport deadLetterTransport = CreateDeadLetterTransport();
            IErrorTransport      errorTransport      = CreateErrorTransport();

            var receiveEndpointContext = new SqsQueueReceiveEndpointContext(_configuration, brokerTopology);

            receiveEndpointContext.GetOrAddPayload(() => deadLetterTransport);
            receiveEndpointContext.GetOrAddPayload(() => errorTransport);

            return(receiveEndpointContext);
        }
示例#2
0
        public SqsReceiveEndpointContext CreateReceiveEndpointContext()
        {
            var brokerTopology = BuildTopology(_configuration.Settings);

            var headerAdapter = new TransportSetHeaderAdapter <MessageAttributeValue>(new SqsHeaderValueConverter(_hostSettings.AllowTransportHeader),
                                                                                      TransportHeaderOptions.IncludeFaultMessage);

            var deadLetterTransport = CreateDeadLetterTransport(headerAdapter);

            var errorTransport = CreateErrorTransport(headerAdapter);

            var receiveEndpointContext = new SqsQueueReceiveEndpointContext(_host, _configuration, brokerTopology);

            receiveEndpointContext.GetOrAddPayload(() => deadLetterTransport);
            receiveEndpointContext.GetOrAddPayload(() => errorTransport);

            return(receiveEndpointContext);
        }