Beispiel #1
0
    public TransportConfigurationResult Configure(SettingsHolder settings, TransportTransactionMode transportTransactionMode)
    {
#if !NETFRAMEWORK
        if (transportTransactionMode == TransportTransactionMode.TransactionScope)
        {
            NUnit.Framework.Assert.Ignore("TransactionScope not supported in .NET Core");
        }
#endif
        this.settings = settings;
        settings.Set(transportTransactionMode);
        settings.Set("NServiceBus.SharedQueue", settings.EndpointName());
        var delayedDeliverySettings = new DelayedDeliverySettings(settings);
        delayedDeliverySettings.TableSuffix("Delayed");

        var pubSubSettings = new SubscriptionSettings();
        pubSubSettings.DisableSubscriptionCache();
        settings.Set(pubSubSettings);

        connectionString = Environment.GetEnvironmentVariable("SqlServerTransportConnectionString");
        if (string.IsNullOrEmpty(connectionString))
        {
            connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True";
        }

        var logicalAddress = LogicalAddress.CreateLocalAddress(settings.ErrorQueueAddress(), new Dictionary <string, string>());
        var localAddress   = settings.EndpointName();
        return(new TransportConfigurationResult
        {
            TransportInfrastructure = new SqlServerTransportInfrastructure("nservicebus", settings, connectionString, () => localAddress, () => logicalAddress, false)
        });
    }
        public AcceptanceTestTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;
            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                storagePath = FindStoragePath();
            }

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");
        }
        public LearningTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;
            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                storagePath = FindStoragePath();
            }

            if (settings.TryGet <ReceiveComponent.Settings>(out var receiveSettings))
            {
                receiveSettings.SetDefaultPushRuntimeSettings(new PushRuntimeSettings(1));
            }

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");
        }
        public LearningTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;
            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                storagePath = FindStoragePath();
            }

            settings.SetDefault(new MessageProcessingOptimizationExtensions.ConcurrencyLimit
            {
                MaxValue = 1
            });

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");
        }
        public TestTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;

            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                var solutionRoot = FindSolutionRoot();
                storagePath = Path.Combine(solutionRoot, ".learningtransport");
            }

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");

            OutboundRoutingPolicy = settings.GetOrDefault <bool>(NoNativePubSub)
                ? new OutboundRoutingPolicy(OutboundRoutingType.Unicast, OutboundRoutingType.Unicast, OutboundRoutingType.Unicast)
                : new OutboundRoutingPolicy(OutboundRoutingType.Unicast, OutboundRoutingType.Multicast, OutboundRoutingType.Unicast);
        }
Beispiel #6
0
        public LearningTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;

            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                var solutionRoot = FindSolutionRoot();
                storagePath = Path.Combine(solutionRoot, ".learningtransport");
            }

            settings.SetDefault <MessageProcessingOptimizationExtensions.ConcurrencyLimit>(new MessageProcessingOptimizationExtensions.ConcurrencyLimit
            {
                MaxValue = 1
            });

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");

            settings.Set(Recoverability.DisableLegacyRetriesSatellite, true);
        }
        public AcceptanceTestingTransportInfrastructure(SettingsHolder settings)
        {
            this.settings = settings;

            if (!settings.TryGet(UseNativeDelayedDeliveryKey, out nativeDelayedDelivery))
            {
                nativeDelayedDelivery = true;
            }

            if (!settings.TryGet(UseNativePubSubKey, out nativePubSub))
            {
                nativePubSub = true;
            }

            if (!settings.TryGet(StorageLocationKey, out storagePath))
            {
                var solutionRoot = FindSolutionRoot();
                storagePath = Path.Combine(solutionRoot, ".attransport");
            }

            var errorQueueAddress = settings.ErrorQueueAddress();

            PathChecker.ThrowForBadPath(errorQueueAddress, "ErrorQueueAddress");
        }