private void PublisherPublishTopicRequest() { Post("/publishMessage", param => { var publisherIDString = GetQueryValueFromKey("id"); var topicName = GetQueryValueFromKey("topicName"); var messageContent = GetQueryValueFromKey("messageContent"); int publisherID; if (int.TryParse(publisherIDString, out publisherID)) { if (topicName.Length > 0 && messageContent.Length > 0 && Broker.SendMessage(publisherID, topicName, messageContent)) { return(GetSuccessJSONMessage($"Message to topic {topicName} was successfully published")); } } return(GetFailureJSONMessage($"Message to topic {topicName} could not be published")); }); }