Beispiel #1
0
        public MessagePump(
            ServiceBusClient serviceBusClient,
            ServiceBusAdministrationClient administrativeClient,
            AzureServiceBusTransport transportSettings,
            string receiveAddress,
            ReceiveSettings receiveSettings,
            Action <string, Exception, CancellationToken> criticalErrorAction,
            NamespacePermissions namespacePermissions)
        {
            Id                       = receiveSettings.Id;
            ReceiveAddress           = receiveAddress;
            this.serviceBusClient    = serviceBusClient;
            this.transportSettings   = transportSettings;
            this.receiveSettings     = receiveSettings;
            this.criticalErrorAction = criticalErrorAction;

            if (receiveSettings.UsePublishSubscribe)
            {
                Subscriptions = new SubscriptionManager(
                    ReceiveAddress,
                    transportSettings,
                    administrativeClient,
                    namespacePermissions);
            }
        }
 public QueueCreator(
     AzureServiceBusTransport transportSettings,
     ServiceBusAdministrationClient administrativeClient,
     NamespacePermissions namespacePermissions)
 {
     this.transportSettings    = transportSettings;
     this.administrativeClient = administrativeClient;
     this.namespacePermissions = namespacePermissions;
     maxSizeInMb = transportSettings.EntityMaximumSize * 1024;
 }
        public SubscriptionManager(string inputQueueName, string topicPath, ServiceBusConnectionStringBuilder connectionStringBuilder, ITokenProvider tokenProvider, NamespacePermissions namespacePermissions, Func <string, string> subscriptionShortener, Func <string, string> ruleShortener)
        {
            this.topicPath = topicPath;
            this.connectionStringBuilder = connectionStringBuilder;
            this.tokenProvider           = tokenProvider;
            this.namespacePermissions    = namespacePermissions;
            this.ruleShortener           = ruleShortener;

            subscriptionName = inputQueueName.Length > maxNameLength?subscriptionShortener(inputQueueName) : inputQueueName;
        }
 public QueueCreator(string mainInputQueueName, string topicName, ServiceBusConnectionStringBuilder connectionStringBuilder, ITokenProvider tokenProvider, NamespacePermissions namespacePermissions, int maxSizeInMB, bool enablePartitioning, Func <string, string> subscriptionShortener)
 {
     this.mainInputQueueName      = mainInputQueueName;
     this.topicName               = topicName;
     this.connectionStringBuilder = connectionStringBuilder;
     this.tokenProvider           = tokenProvider;
     this.namespacePermissions    = namespacePermissions;
     this.maxSizeInMB             = maxSizeInMB;
     this.enablePartitioning      = enablePartitioning;
     this.subscriptionShortener   = subscriptionShortener;
 }
Beispiel #5
0
        public SubscriptionManager(string inputQueueName, string topicPath, ServiceBusConnectionStringBuilder connectionStringBuilder, ITokenProvider tokenProvider, NamespacePermissions namespacePermissions, Func <string, string> subscriptionFactory, Func <Type, string> ruleNameFactory, Func <Type, string> sqlExpressionFactory)
        {
            this.topicPath = topicPath;
            this.connectionStringBuilder = connectionStringBuilder;
            this.tokenProvider           = tokenProvider;
            this.namespacePermissions    = namespacePermissions;
            this.ruleNameFactory         = ruleNameFactory;
            this.sqlExpressionFactory    = sqlExpressionFactory;

            subscriptionName = subscriptionFactory(inputQueueName);
        }
        public SubscriptionManager(
            string subscribingQueue,
            AzureServiceBusTransport transportSettings,
            ServiceBusAdministrationClient administrativeClient,
            NamespacePermissions namespacePermissions)
        {
            this.subscribingQueue     = subscribingQueue;
            this.transportSettings    = transportSettings;
            this.administrativeClient = administrativeClient;
            this.namespacePermissions = namespacePermissions;

            subscriptionName = transportSettings.SubscriptionNamingConvention(subscribingQueue);
        }
Beispiel #7
0
        public AzureServiceBusTransportInfrastructure(SettingsHolder settings, string connectionString)
        {
            this.settings           = settings;
            connectionStringBuilder = new ServiceBusConnectionStringBuilder(connectionString);

            if (settings.TryGet(SettingsKeys.TransportType, out TransportType transportType))
            {
                connectionStringBuilder.TransportType = transportType;
            }

            settings.TryGet(SettingsKeys.CustomTokenProvider, out tokenProvider);

            if (!settings.TryGet(SettingsKeys.TopicName, out topicName))
            {
                topicName = defaultTopicName;
            }

            settings.EnableFeatureByDefault <TransactionScopeSuppressFeature>();

            namespacePermissions = new NamespacePermissions(connectionStringBuilder, tokenProvider);

            WriteStartupDiagnostics();
        }