/// <summary> /// Initializes a new instance of the <see cref="MessageHeader" /> class. /// </summary> public MessageHeader() { IdentificationService = new Identification(); CreatedAt = DateTime.UtcNow; CallContext = new Session(); CallStack = new Stack<CallerContext>(); MessageId = Guid.NewGuid(); }
/// <summary> /// Initializes a new instance of the <see cref="MessageHeader" /> class. /// </summary> /// <param name="identificationService">The identification service.</param> /// <param name="callContext">The call context.</param> /// <param name="callStack">The call stack.</param> /// <param name="createdAt">The created at.</param> private MessageHeader(Identification identificationService, Session callContext, Stack<CallerContext> callStack, DateTime createdAt) { IdentificationService = identificationService; CallContext = callContext; CallStack = callStack; CreatedAt = createdAt; MessageId = Guid.NewGuid(); }
/// <summary> /// Publishes the specified message. /// </summary> /// <param name="message">The message.</param> /// <param name="priority">The priority.</param> /// <param name="callContext">The call context.</param> public void Publish(IMessage message, int priority, Session callContext) { var messageInfo = new MessageInfo { Header = { Priority = priority, CallContext = callContext }, CurrentCallContext = callContext}; _outputGateway.Send(message, messageInfo); }
/// <summary> /// Creates the specified session. /// </summary> /// <param name="session">The session.</param> /// <param name="callContext">The call context.</param> /// <returns></returns> public static IContextHandler Create(Session session, Session callContext) { return new ContextHandler { Session = session, CallContext = callContext }; }