public bool IsInitQueue(string serviceName) { try { IBusQueue queue = GetQueue(serviceName); if (queue == null) { IServiceConfiguration config = _config.Services.FirstOrDefault(x => x.ServiceName == serviceName); if (config != null) { queue = new BusQueue(_connection, config, _logger); _queueList.Add(queue); } if (queue == null) { return(false); } } return(queue.TryInit()); } catch (Exception e) { _logger?.LogError(e, $"{_config.LocalIP} : {_config.ApplicationName}.{typeof(BusManager).FullName} : {e.Message}"); return(false); } }
public void Setup() { var random = new Random(); var name = string.Format("a{0}b", random.Next()); queue = new BusQueue(name, connection); queue.CreateIfNotExists().Wait(); }
/// <summary> /// Constructor /// </summary> /// <param name="queue">Service Bus Queue</param> public InitializeBusQueue(IBusQueue queue) { if (null == queue) { throw new ArgumentNullException("queue"); } this.queue = queue; }
/// <summary> /// Constructor /// </summary> /// <param name="queue">Queue</param> public BusQueueTimingTracker(IBusQueue queue) : base(TimeSpan.FromMinutes(1), MaxBatchSize) { if (null == queue) { throw new ArgumentNullException("queue"); } this.queue = queue; }
/// <summary> /// Constructor /// </summary> /// <param name="queue">Queue</param> public QueueTimingTracker(IBusQueue queue) : base(TimeSpan.FromMinutes(1), MaxBatchSize) { if (null == queue) { throw new ArgumentNullException("queue"); } this.queue = queue; }
public bool IsInitQueues() { if (_config.Services == null) { return(true); } if (_connection.TryConnect()) { foreach (var serviceConfiguration in _config.Services) { IBusQueue queue = GetQueue(serviceConfiguration.ServiceName); if (queue == null || queue.TryInit()) { return(false); } } } return(false); }