コード例 #1
0
 internal ServiceBusEventBus(ISubscriptionClient subscriptionClient, ITopicClient topicClient, ServiceBusOptions serviceBusOptions,
                             ISubscriptionManager subscriptionManager, IHandlerResolver handlerResolver, ILogger <ServiceBusEventBus> logger)
 {
     _subscriptionClient  = subscriptionClient ?? throw new ArgumentNullException(nameof(subscriptionClient));
     _topicClient         = topicClient ?? throw new ArgumentNullException(nameof(topicClient));
     _serviceBusOptions   = serviceBusOptions ?? throw new ArgumentNullException(nameof(serviceBusOptions));
     _subscriptionManager = subscriptionManager ?? throw new ArgumentNullException(nameof(subscriptionManager));
     _handlerResolver     = handlerResolver ?? throw new ArgumentNullException(nameof(handlerResolver));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #2
0
        public static ServiceBusEventBus Build(string connectionString, string topic, string subscription, ServiceBusOptions options,
                                               IServiceProvider serviceProvider)
        {
            var topicClient         = new TopicClient(connectionString, topic);
            var subscriptionClient  = new SubscriptionClient(connectionString, topic, subscription);
            var subscriptionManager = new SubscriptionManager();
            var providerResolver    = new ServiceProviderResolver(serviceProvider);
            var logger = serviceProvider.GetService <ILogger <ServiceBusEventBus> >();

            return(new ServiceBusEventBus(subscriptionClient, topicClient, options,
                                          subscriptionManager, providerResolver, logger));
        }