public IMessagingChannel CreateConnection( ServiceBusConnector connector, ServiceBusChannelGroupConfiguration config) { SubscriptionClient subscriptionClient = null; if (!config.DispatchOnly) { subscriptionClient = SubscriptionClient.CreateFromConnectionString( _connectionString, config.InputHubPath, "allmessages"); } var topicClient = TopicClient.CreateFromConnectionString(_connectionString, config.InputHubPath); return(new AzureTopicChannel(connector, config, topicClient, subscriptionClient, CancellationToken.None)); }
public AzureTopicChannel( ServiceBusConnector connector, ServiceBusChannelGroupConfiguration configuration, TopicClient topicClient, SubscriptionClient subscriptionClient, CancellationToken shutdownToken) { _connector = connector; _configuration = configuration; _topicClient = topicClient; _subscriptionClient = subscriptionClient; _masterShutdownTokenRegistration = shutdownToken .Register(() => _shutdownToken.Cancel()); _identifier = Interlocked.Increment(ref _nextIdentifier); CurrentResolver = configuration.DependencyResolver; CurrentTransaction = null; }