NServiceBus.MsmqTransportInfrastructure.ConfigureReceiveInfrastructure C# (CSharp) Method

ConfigureReceiveInfrastructure() public method

public ConfigureReceiveInfrastructure ( ) : TransportReceiveInfrastructure
return TransportReceiveInfrastructure
        public override TransportReceiveInfrastructure ConfigureReceiveInfrastructure()
        {
            new CheckMachineNameForComplianceWithDtcLimitation().Check();

            MsmqScopeOptions scopeOptions;

            if (!settings.TryGet(out scopeOptions))
            {
                scopeOptions = new MsmqScopeOptions();
            }

            var msmqSettings = settings.Get<MsmqSettings>();

            return new TransportReceiveInfrastructure(
                () => new MessagePump(guarantee => SelectReceiveStrategy(guarantee, scopeOptions.TransactionOptions)),
                () => new MsmqQueueCreator(msmqSettings.UseTransactionalQueues),
                () =>
                {
                    var bindings = settings.Get<QueueBindings>();

                    foreach (var address in bindings.ReceivingAddresses)
                    {
                        QueuePermissions.CheckQueue(address);
                    }
                    return Task.FromResult(StartupCheckResult.Success);
                });
        }