public ServiceBusManager(ServiceBusSetting setting, ILoggerFactory logger) { this.logger = logger.CreateLogger <ServiceBusManager>(); this.setting = setting; CheckSetting(); client = new ManagementClient(setting.ConnectionString); }
public ServiceBusSender(ServiceBusSetting setting, ILoggerFactory logger) { this.logger = logger.CreateLogger <ServiceBusSender <T> >(); this.setting = setting; manager = new ServiceBusManager(setting, logger); manager.CreateIfNotExisted().Wait(); sender = new MessageSender(setting.ConnectionString, setting.IsTopic ? setting.TopicPath : setting.QueueName); }
public ServiceBusReceiver(ServiceBusSetting setting, IMessageProcessor <T> processor, ILoggerFactory logger) { this.logger = logger.CreateLogger <ServiceBusReceiver <T> >(); this.processor = processor; this.setting = setting; isTopic = setting.IsTopic; manager = new ServiceBusManager(setting, logger); manager.CreateIfNotExisted().Wait(); if (isTopic) { manager.AddSubscribtionIfNotExisted(subscriptionId).Wait(); } receiver = new MessageReceiver(setting.ConnectionString, isTopic ? $"{setting.TopicPath}/subscriptions/{subscriptionId}" : setting.QueueName); }