public AzureServiceBusQueueClient( string connectionString, string queueName) { connectionString = connectionString.ToLowerInvariant(); queueName = queueName.ToLowerInvariant(); _queueKey = $"{connectionString}:{queueName}".GetHashCode(); _queue = _queues.AddOrUpdate( _queueKey, new AzureServiceBusQueue(connectionString, queueName), (_, queue) => { queue.IncrementReferenceCount(); return(queue); }); _messageReceiver = _queue.MessageReceiver; _messageSender = _queue.MessageSender; }
public AzureServiceBusQueueClient( string connectionString, string queueName, int prefetchCount, bool disposeQueueWhenNotInUse) { _queueKey = $"{connectionString}:{queueName}:{prefetchCount}".GetHashCode(); _queue = _queues.AddOrUpdate( _queueKey, new AzureServiceBusQueue(connectionString, queueName, prefetchCount), (_, queue) => { queue.IncrementReferenceCount(); return(queue); }); _messageReceiver = _queue.MessageReceiver; _messageSender = _queue.MessageSender; _disposeQueueWhenNotInUse = disposeQueueWhenNotInUse; }