'use strict';
const uuid = require('uuid');
module.exports = class Envelope {
/*
string MessageId
string CorrelationId
string ConversationId
string InitiatorId
string RequestId
string SourceAddress
string DestinationAddress
string ResponseAddress
string FaultAddress
DateTime? ExpirationTime
IDictionary<string, object> Headers
object Message
string[] MessageType
HostInfo Host
*/
constructor(destinationAddress, messageType, message) {
this.MessageId = uuid.v4();
// this.CorrelationId = null;
// this.ConversationId = null;
// this.InitiatorId = null;
// this.RequestId = null;
// this.SourceAddress = null;
this.DestinationAddress = destinationAddress; // e.g. rabbitmq://localhost/my_queue
// this.ResponseAddress = null;
// this.FaultAddress = null;
// this.ExpirationTime = null;
this.Headers = {};
this.Message = message;
this.MessageType = [messageType.toString()];
// this.HostInfo = {};
}
};