Esempio n. 1
0
 public ServiceBusManager(ServiceBusSetting setting, ILoggerFactory logger)
 {
     this.logger  = logger.CreateLogger <ServiceBusManager>();
     this.setting = setting;
     CheckSetting();
     client = new ManagementClient(setting.ConnectionString);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }