Beispiel #1
0
        private void SetupInboundQueue(AzureCloudServiceSettings settings)
        {
            var options = new QueueReceiverOptions
            {
                NamespaceName = NamespaceName,
                QueueName     = "inbound-" + settings.ControllerId,
                Authorization = settings.InboundQueueAuthorization
            };

            _inboundQueue = new QueueReceiver(options, _log);
            _inboundQueue.MessageReceived += DistpachMessage;
            _inboundQueue.Enable();
        }
Beispiel #2
0
        public QueueReceiver(QueueReceiverOptions options, ILogger log)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            _log = log;
            _uri = new Uri($"https://{options.NamespaceName}.servicebus.windows.net/{options.QueueName}/messages/head?api-version=2015-01&timeout={(int)options.Timeout.TotalSeconds}");
            _httpClient.DefaultRequestHeaders.TryAppendWithoutValidation("Authorization", options.Authorization);
        }