/// <summary>Initializes a new instance of the <see cref="NsqdHttpPublisher"/> class.</summary> /// <exception cref="ArgumentNullException">Thrown when <paramref name="nsqdHttpEndpoint"/> is null or empty. /// </exception> /// <param name="nsqdHttpEndpoint">The nsqd HTTP endpoint.</param> /// <param name="httpRequestTimeout">The HTTP request timeout.</param> public NsqdHttpPublisher(string nsqdHttpEndpoint, TimeSpan httpRequestTimeout) { if (string.IsNullOrEmpty(nsqdHttpEndpoint)) throw new ArgumentNullException("nsqdHttpEndpoint"); _nsqdHttpClient = new NsqdHttpClient(nsqdHttpEndpoint, httpRequestTimeout); }
static ProducerTest() { _nsqdHttpClient = new NsqdHttpClient("127.0.0.1:4151", TimeSpan.FromSeconds(5)); _nsqLookupdHttpClient = new NsqLookupdHttpClient("127.0.0.1:4161", TimeSpan.FromSeconds(5)); }
private void GetNsqdInformation(ProducerInformation nsqdNode) { var httpUri = string.Format("http://{0}:{1}", nsqdNode.BroadcastAddress, nsqdNode.HttpPort); var client = new NsqdHttpClient(httpUri, TimeSpan.FromSeconds(10)); var stats = client.GetStats(); var topics = new List<TopicModel>(Topics); foreach (var topic in topics) { var nsqdTopic = stats.Topics.SingleOrDefault(p => p.TopicName == topic.Topic); //int? messageCount = nsqdTopic == null ? (int?)null : nsqdTopic.MessageCount; topic.SetNsqdStats(nsqdNode, nsqdTopic); } }
static ConsumerRdyRedistributionTest() { _nsqdHttpClient1 = new NsqdHttpClient("127.0.0.1:4151", TimeSpan.FromSeconds(5)); _nsqdHttpClient2 = new NsqdHttpClient("127.0.0.1:5151", TimeSpan.FromSeconds(5)); _nsqLookupdHttpClient = new NsqLookupdHttpClient("127.0.0.1:4161", TimeSpan.FromSeconds(5)); }