private void LogMessage(object sender, MessageReceivedEventArgs e)
 {
     new TextBoxLogger(LogTextBox).Info("MESSAGE: " + e.BrokerProperties + " " + e.Body);
 }
        private void DistpachMessage(object sender, MessageReceivedEventArgs e)
        {
            var correlationId = (string)e.Body["CorrelationId"];
            var uri = (string)e.Body["Uri"];
            var request = (JObject)e.Body["Content"] ?? new JObject();

            var context = new QueueBasedApiContext(correlationId, uri, request, new JObject());
            var eventArgs = new ApiRequestReceivedEventArgs(context);
            RequestReceived?.Invoke(this, eventArgs);

            if (!eventArgs.IsHandled)
            {
                context.ResultCode = ApiResultCode.UnknownUri;
            }

            SendResponseMessage(context).Wait();
        }