private void SendMessage(NodeFrontMessage message)
        {
            try
            {
                var fullUrl = new Uri(new Uri(_nodeFrontUrl), message.Url);

                var request = WebRequest.Create(fullUrl) as HttpWebRequest;
                request.Method      = "POST";
                request.ContentType = "application/json";
                request.ServicePoint.Expect100Continue = false;
                request.Timeout = 30000;

                using (var requestStream = request.GetRequestStream())
                {
                    using (var writer = new StreamWriter(requestStream))
                    {
                        var serializer = new JsonSerializer();
                        serializer.NullValueHandling = NullValueHandling.Ignore;
                        serializer.Serialize(writer, message.Data);
                    }
                }

                using (var resp = request.GetResponse())
                {
                    resp.Close();
                }
            }
            catch (Exception)
            {
                Console.Write("Error sending log to nodefront");
            }
        }
        public void Start()
        {
            _workerTask = Task.Factory.StartNew(() =>
            {
                while (!_messages.IsCompleted)
                {
                    NodeFrontMessage message = null;

                    try
                    {
                        message = _messages.Take();
                    }
                    catch (InvalidOperationException) { }

                    SendMessage(message);
                }
            }, TaskCreationOptions.LongRunning);
        }
        private void SendMessage(NodeFrontMessage message)
        {
            try
            {
                var fullUrl = new Uri(new Uri(_nodeFrontUrl), message.Url);

                var request = WebRequest.Create(fullUrl) as HttpWebRequest;
                request.Method = "POST";
                request.ContentType = "application/json";
                request.ServicePoint.Expect100Continue = false;
                request.Timeout = 30000;

                using (var requestStream = request.GetRequestStream())
                {
                    using (var writer = new StreamWriter(requestStream))
                    {
                        var serializer = new JsonSerializer();
                        serializer.NullValueHandling = NullValueHandling.Ignore;
                        serializer.Serialize(writer, message.Data);
                    }
                }

                using (var resp = request.GetResponse())
                {
                    resp.Close();
                }

            }
            catch (Exception ex)
            {
                Console.Write("Error sending log to nodefront");
            }
        }
        private void SendMessage(NodeFrontMessage message)
        {
            try
            {
                var fullUrl = new Uri(new Uri(_nodeFrontUrl), message.Url);

                var request = WebRequest.Create(fullUrl) as HttpWebRequest;
                request.Method = "POST";
                request.ContentType = "application/json";
                request.ServicePoint.Expect100Continue = false;
                request.Timeout = 3000;

                using (var requestStream = request.GetRequestStream())
                {
                    using (var writer = new StreamWriter(requestStream))
                    {
                        new JsonSerializer().Serialize(writer, message.Data);
                    }
                }

                using (var resp = request.GetResponse())
                {
                    resp.Close();
                }

            }
            catch (Exception) { }
        }