/// <summary> /// Initializes a new instance of the <see cref="MessageBus"/> class. /// </summary> public MessageBus() { Header = new MessageHeader(); }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns></returns> public bool Equals(MessageHeader other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.IdentificationService, IdentificationService) && Equals(other.BodyType, BodyType) && other.CreatedAt.Equals(CreatedAt) && other.EncodingCodePage == EncodingCodePage && other.ReinjectionNumber == ReinjectionNumber && other.Priority == Priority && Equals(other.Type, Type); }
/// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// <returns> /// A new object that is a copy of this instance. /// </returns> public object Clone() { var messageHeader = new MessageHeader(IdentificationService, (Session) CallContext.Clone(), new Stack<CallerContext>(CallStack.Reverse()), CreatedAt) { BodyType = BodyType, EncodingCodePage = EncodingCodePage, Priority = Priority, ReinjectionNumber = ReinjectionNumber, Type = Type, }; return messageHeader; }
/// <summary> /// Invokes the on error handler. /// </summary> /// <param name="message">The message.</param> /// <param name="header">The header.</param> /// <param name="handlerType">Type of the handler.</param> /// <param name="exception">The exception.</param> /// <param name="messageBus"></param> private void InvokeOnErrorHandler(string message, MessageHeader header, byte[] messageBus, Type handlerType, Exception exception) { ErrorOnHandlersEventHandler handler = OnErrorHandler; if (handler != null) handler(this, new ErrorOnHandlersEventHandlerArgs { Message = message, Header = header, HandlerType = handlerType, Exception = exception, MessageBus = messageBus }); }
/// <summary> /// Initializes a new instance of the <see cref="MessageInfo"/> class. /// </summary> public MessageInfo() { Header = new MessageHeader(); }