public MessageDispatcher(QueueAddressTranslator addressTranslator, IMulticastToUnicastConverter multicastToUnicastConverter, TableBasedQueueCache tableBasedQueueCache, IDelayedMessageStore delayedMessageTable, SqlConnectionFactory connectionFactory) { this.addressTranslator = addressTranslator; this.multicastToUnicastConverter = multicastToUnicastConverter; this.tableBasedQueueCache = tableBasedQueueCache; this.delayedMessageTable = delayedMessageTable; this.connectionFactory = connectionFactory; }
public QueueCreator(SqlConnectionFactory connectionFactory, QueueAddressTranslator addressTranslator, CanonicalQueueAddress delayedQueueAddress, bool createMessageBodyColumn = false) { this.connectionFactory = connectionFactory; this.addressTranslator = addressTranslator; this.delayedQueueAddress = delayedQueueAddress; this.createMessageBodyColumn = createMessageBodyColumn; }
internal SqlServerTransportInfrastructure(string catalog, SettingsHolder settings, string connectionString, Func <string> localAddress, Func <LogicalAddress> logicalAddress) { this.settings = settings; this.connectionString = connectionString; this.localAddress = localAddress; this.logicalAddress = logicalAddress; if (settings.HasSetting(SettingsKeys.DisableNativePubSub)) { OutboundRoutingPolicy = new OutboundRoutingPolicy(OutboundRoutingType.Unicast, OutboundRoutingType.Unicast, OutboundRoutingType.Unicast); } else { OutboundRoutingPolicy = new OutboundRoutingPolicy(OutboundRoutingType.Unicast, OutboundRoutingType.Multicast, OutboundRoutingType.Unicast); } settings.TryGet(SettingsKeys.DefaultSchemaSettingsKey, out string defaultSchemaOverride); var queueSchemaSettings = settings.GetOrDefault <QueueSchemaAndCatalogSettings>(); addressTranslator = new QueueAddressTranslator(catalog, "dbo", defaultSchemaOverride, queueSchemaSettings); tableBasedQueueCache = new TableBasedQueueCache(addressTranslator); connectionFactory = CreateConnectionFactory(); //Configure the schema and catalog for logical endpoint-based routing var schemaAndCatalogSettings = settings.GetOrCreate <EndpointSchemaAndCatalogSettings>(); settings.GetOrCreate <EndpointInstances>().AddOrReplaceInstances("SqlServer", schemaAndCatalogSettings.ToEndpointInstances()); //Needs to be invoked here and not when configuring the receiving infrastructure because the EnableMigrationMode flag has to be set up before feature component is initialized. HandleTimeoutManagerCompatibilityMode(); var pubSubSettings = settings.GetOrCreate <SubscriptionSettings>(); var subscriptionTableName = pubSubSettings.SubscriptionTable.Qualify(defaultSchemaOverride ?? "dbo", catalog); subscriptionStore = new PolymorphicSubscriptionStore(new SubscriptionTable(subscriptionTableName.QuotedQualifiedName, connectionFactory)); var timeToCacheSubscriptions = pubSubSettings.TimeToCacheSubscriptions; if (timeToCacheSubscriptions.HasValue) { subscriptionStore = new CachedSubscriptionStore(subscriptionStore, timeToCacheSubscriptions.Value); } var subscriptionTableCreator = new SubscriptionTableCreator(subscriptionTableName, connectionFactory); settings.Set(subscriptionTableCreator); }
internal SqlServerTransportInfrastructure(QueueAddressTranslator addressTranslator, SettingsHolder settings, string connectionString) { this.addressTranslator = addressTranslator; this.settings = settings; this.connectionString = connectionString; schemaAndCatalogSettings = settings.GetOrCreate <EndpointSchemaAndCatalogSettings>(); delayedDeliverySettings = settings.GetOrDefault <DelayedDeliverySettings>(); var timeoutManagerFeatureDisabled = settings.GetOrDefault <FeatureState>(typeof(TimeoutManager).FullName) == FeatureState.Disabled; if (delayedDeliverySettings != null && timeoutManagerFeatureDisabled) { delayedDeliverySettings.DisableTimeoutManagerCompatibility(); } //HINT: this flag indicates that user need to explicitly turn outbox in configuration. RequireOutboxConsent = true; }
internal SqlServerTransportInfrastructure(QueueAddressTranslator addressTranslator, SettingsHolder settings, string connectionString) { this.addressTranslator = addressTranslator; this.settings = settings; this.connectionString = connectionString; schemaAndCatalogSettings = settings.GetOrCreate <EndpointSchemaAndCatalogSettings>(); delayedDeliverySettings = settings.GetOrDefault <DelayedDeliverySettings>(); var timeoutManagerFeatureDisabled = settings.GetOrDefault <FeatureState>(typeof(TimeoutManager).FullName) == FeatureState.Disabled; diagnostics.Add("NServiceBus.Transport.SqlServer.TimeoutManager", new { FeatureEnabled = !timeoutManagerFeatureDisabled }); if (delayedDeliverySettings != null && timeoutManagerFeatureDisabled) { delayedDeliverySettings.DisableTimeoutManagerCompatibility(); } }
public QueueCreator(SqlConnectionFactory connectionFactory, QueueAddressTranslator addressTranslator, bool createMessageBodyColumn = false) { this.connectionFactory = connectionFactory; this.addressTranslator = addressTranslator; this.createMessageBodyColumn = createMessageBodyColumn; }
public TableBasedQueueOperationsReader(QueueAddressTranslator addressTranslator) { this.addressTranslator = addressTranslator; }
public QueueCreator(SqlConnectionFactory connectionFactory, QueueAddressTranslator addressTranslator) { this.connectionFactory = connectionFactory; this.addressTranslator = addressTranslator; }
public TableBasedQueueCache(QueueAddressTranslator addressTranslator) { this.addressTranslator = addressTranslator; }
public static SortingResult SortAndDeduplicate(this IEnumerable <UnicastTransportOperation> source, QueueAddressTranslator addressTranslator) { Dictionary <DeduplicationKey, UnicastTransportOperation> isolatedDispatch = null; Dictionary <DeduplicationKey, UnicastTransportOperation> defaultDispatch = null; foreach (var operation in source) { var destination = addressTranslator.Parse(operation.Destination).Address; var messageId = operation.Message.MessageId; var deduplicationKey = new DeduplicationKey(messageId, destination); if (operation.RequiredDispatchConsistency == DispatchConsistency.Default) { if (defaultDispatch == null) { defaultDispatch = new Dictionary <DeduplicationKey, UnicastTransportOperation>(); } defaultDispatch[deduplicationKey] = operation; } else if (operation.RequiredDispatchConsistency == DispatchConsistency.Isolated) { if (isolatedDispatch == null) { isolatedDispatch = new Dictionary <DeduplicationKey, UnicastTransportOperation>(); } isolatedDispatch[deduplicationKey] = operation; } } return(new SortingResult(defaultDispatch?.Values, isolatedDispatch?.Values)); }
public MessageDispatcher(IQueueDispatcher dispatcher, QueueAddressTranslator addressTranslator) { this.dispatcher = dispatcher; this.addressTranslator = addressTranslator; }