/// <summary> /// Initializes a new instance of the <see cref="Message"/> class. /// </summary> public Message() { Header = new MessageHeader(messageId: Guid.Empty, topic: string.Empty, messageType: MessageType.MT_NONE); Body = new MessageBody(string.Empty); }
/// <summary> /// Initializes a new instance of the <see cref="Message"/> class. /// </summary> /// <param name="header">The header.</param> /// <param name="body">The body.</param> public Message(MessageHeader header, MessageBody body) { Header = header; Body = body; }
private static Message CreateMessage(int eventNumber) { var body = new MessageBody("{companyId:123}"); var header = new MessageHeader(Guid.NewGuid(), "Topic", MessageType.MT_EVENT); header.Bag.Add("impersonatorId", 123); header.Bag.Add("eventNumber", eventNumber); header.Bag.Add("streamId", StreamName); return new Message(header, body); }