static Message NewMessage(int i) { Message newMessage = new Message(); newMessage.Name = "Name"; newMessage.Body = "Body"; newMessage.Number = i; return newMessage; }
public static Message FromString(string messageContent) { Message message = new Message(); string[] fields = messageContent.Split('|'); message.Name = fields[0]; message.Body = fields[1]; message.Number = Convert.ToInt32(fields[2]); return message; }
public void SendMessage(Message message) { Byte[] body = Encoding.UTF8.GetBytes(message.ToString()); _channel.BasicPublish("", "hello", null, body); }