protected AzureServiceBusTransportInfrastructure(SettingsHolder settings)
        {
            TransactionMode  = settings.SupportedTransactionMode();
            Settings         = settings;
            TopologySettings = settings.GetOrCreate <TopologySettings>();

            var individualizationStrategyType = (Type)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Individualization.Strategy);

            individualization = individualizationStrategyType.CreateInstance <IIndividualizationStrategy>(Settings);

            var compositionStrategyType = (Type)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Composition.Strategy);
            var compositionStrategy     = compositionStrategyType.CreateInstance <ICompositionStrategy>(Settings);

            var sanitizationStrategyType = (Type)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Sanitization.Strategy);
            var sanitizationStrategy     = sanitizationStrategyType.CreateInstance <ISanitizationStrategy>(Settings);

            addressingLogic = new AddressingLogic(sanitizationStrategy, compositionStrategy);
        }
        void BuildTopicBundles(RuntimeNamespaceInfo[] namespaces, AddressingLogic addressingLogic)
        {
            var numberOfEntitiesInBundle = settings.Get <int>(WellKnownConfigurationKeys.Topology.Bundling.NumberOfEntitiesInBundle);
            var bundlePrefix             = settings.Get <string>(WellKnownConfigurationKeys.Topology.Bundling.BundlePrefix);

            foreach (var @namespace in namespaces)
            {
                var numberOfTopicsFound    = namespaceBundleConfigurations.Value.GetNumberOfTopicInBundle(@namespace.Alias);
                var numberOfTopicsToCreate = Math.Max(numberOfEntitiesInBundle, numberOfTopicsFound);
                for (var i = 1; i <= numberOfTopicsToCreate; i++)
                {
                    var topicEntity = new EntityInfo
                    {
                        Path      = addressingLogic.Apply(bundlePrefix + i, EntityType.Topic).Name,
                        Type      = EntityType.Topic,
                        Namespace = @namespace
                    };
                    topics.Add(topicEntity);
                }
            }
        }
 // all dependencies required are passed in. no protected field can be assumed created
 protected abstract ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing);
 public EndpointOrientedMigrationTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, PublishersConfiguration publishersConfiguration, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic)
 {
     this.namespaceConfigurations       = namespaceConfigurations;
     this.defaultNameSpaceAlias         = defaultNameSpaceAlias;
     this.originalEndpointName          = originalEndpointName;
     this.addressingLogic               = addressingLogic;
     this.namespacePartitioningStrategy = namespacePartitioningStrategy;
     this.publishersConfiguration       = publishersConfiguration;
 }
 public EndpointOrientedMigrationTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, PublishersConfiguration publishersConfiguration, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic, ICreateBrokerSideSubscriptionFilter brokerSideSubscriptionFilterFactory)
 {
     this.namespaceConfigurations             = namespaceConfigurations;
     this.defaultNameSpaceAlias               = defaultNameSpaceAlias;
     this.originalEndpointName                = originalEndpointName;
     this.addressingLogic                     = addressingLogic;
     this.namespacePartitioningStrategy       = namespacePartitioningStrategy;
     this.publishersConfiguration             = publishersConfiguration;
     this.brokerSideSubscriptionFilterFactory = brokerSideSubscriptionFilterFactory;
 }
        protected override ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing)
        {
            var conventions                         = Settings.Get <Conventions>();
            var publishersConfiguration             = new PublishersConfiguration(conventions, Settings);
            var endpointName                        = Settings.EndpointName();
            var topicSettings                       = Settings.GetOrCreate <TopologySettings>().TopicSettings;
            var topicCustomizer                     = topicSettings.DescriptionCustomizer;
            var brokerSideSubscriptionFilterFactory = (ICreateBrokerSideSubscriptionFilter)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Sanitization.BrokerSideSubscriptionFilterFactoryInstance);

            topicSettings.DescriptionCustomizer = description =>
            {
                // call customer defined one first
                topicCustomizer(description);

                if (description.Path != EndpointOrientedMigrationTopologySectionManager.MigrationTopicName)
                {
                    return;
                }

                description.RequiresDuplicateDetection          = true;
                description.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(60);
            };

            return(new EndpointOrientedMigrationTopologySectionManager(defaultAlias, namespaces, endpointName, publishersConfiguration, partitioning, addressing, brokerSideSubscriptionFilterFactory));
        }
Пример #7
0
 public ForwardingTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, int numberOfEntitiesInBundle, string bundlePrefix, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic)
 {
     this.bundlePrefix                  = bundlePrefix;
     this.numberOfEntitiesInBundle      = numberOfEntitiesInBundle;
     this.namespaceConfigurations       = namespaceConfigurations;
     this.defaultNameSpaceAlias         = defaultNameSpaceAlias;
     this.addressingLogic               = addressingLogic;
     this.namespacePartitioningStrategy = namespacePartitioningStrategy;
     this.originalEndpointName          = originalEndpointName;
 }