Inheritance: MessageBody
コード例 #1
0
        public static void SendError(RaygunClient client, Exception e, StoredMessage storedMessage)
        {
            var extraData = StoredMessageToDictionary(storedMessage);
            AddServiceControlVersion(extraData);

            client.SendInBackground(e, null, extraData);
        }
コード例 #2
0
 public ExceptionDetails(StoredMessage message)
 {
     ExceptionType = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
     Message = message.GetHeaderByKey(MessageHeaderKeys.ExceptionMessage);
     Source = message.GetHeaderByKey(MessageHeaderKeys.ExceptionSource);
     StackTrace = message.GetHeaderByKey(MessageHeaderKeys.ExceptionStackTrace);
 }
コード例 #3
0
 public void Display(StoredMessage selectedMessage)
 {
     if (SelectedMessage == selectedMessage) //Workaround, to force refresh the property. Should refactor to use the same approach as hex viewer.
     {
         OnSelectedMessageChanged();
     }
     else
     {
         SelectedMessage = selectedMessage;
     }
 }
コード例 #4
0
        public void Should_not_throw_when_message_has_preamble_header()
        {
            ((IViewAware)viewModel).AttachView(view); //Activetes the view

            var messageBodyWithBOM = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) + TestMessage;

            var message = new StoredMessage
            {
                Body = new PresentationBody
                {
                    Text = messageBodyWithBOM
                }
            };

            Should.NotThrow(() => viewModel.Display(message));
            view.Received().Display(Arg.Is(messageBodyWithBOM));
        }
コード例 #5
0
 public MessageTreeNode(StoredMessage msg)
 {
     Message = msg;
     Parent = msg.GetHeaderByKey(MessageHeaderKeys.RelatedTo, null);
 }
コード例 #6
0
        Arrow CreateArrow(StoredMessage message)
        {
            var arrow = new Arrow(message, container)
            {
                Name = TypeHumanizer.ToName(message.MessageType)
            };

            if (message.MessageIntent == MessageIntent.Publish)
            {
                arrow.Type = ArrowType.Event;
            }
            else
            {
                var isTimeoutString = message.GetHeaderByKey(MessageHeaderKeys.IsSagaTimeout);
                var isTimeout = !string.IsNullOrEmpty(isTimeoutString) && bool.Parse(isTimeoutString);
                if (isTimeout)
                {
                    arrow.Type = ArrowType.Timeout;
                }
                else if (Equals(message.ReceivingEndpoint, message.SendingEndpoint))
                {
                    arrow.Type = ArrowType.Local;
                }
                else
                {
                    arrow.Type = ArrowType.Command;
                }
            }

            return arrow;
        }
コード例 #7
0
        void UpdateProcessingHandler(Handler processingHandler, StoredMessage message, EndpointItem processingEndpoint)
        {
            processingHandler.ProcessedAt = message.ProcessedAt;
            processingHandler.ProcessingTime = message.ProcessingTime;
            processingHandler.Name = TypeHumanizer.ToName(message.MessageType);

            if (message.InvokedSagas != null && message.InvokedSagas.Count > 0)
            {
                processingHandler.PartOfSaga = string.Join(", ", Array.ConvertAll(message.InvokedSagas.ToArray(), x => TypeHumanizer.ToName(x.SagaType)));
            }

            if (message.Status == MessageStatus.ArchivedFailure || message.Status == MessageStatus.Failed || message.Status == MessageStatus.RepeatedFailure)
            {
                processingHandler.State = HandlerState.Fail;
            }
            else
            {
                processingHandler.State = HandlerState.Success;
            }
        }
コード例 #8
0
        Handler CreateProcessingHandler(StoredMessage message, EndpointItem processingEndpoint)
        {
            var handler = new Handler(message.MessageId, container)
            {
                Endpoint = processingEndpoint
            };

            UpdateProcessingHandler(handler, message, processingEndpoint);

            return handler;
        }
コード例 #9
0
 public bool DisplayPropertiesChanged(StoredMessage focusedMessage) => (focusedMessage == null) ||
 (Status != focusedMessage.Status) ||
 (TimeSent != focusedMessage.TimeSent) ||
 (ProcessingTime != focusedMessage.ProcessingTime) ||
 (ReceivingEndpoint != focusedMessage.ReceivingEndpoint) ||
 (SendingEndpoint != focusedMessage.SendingEndpoint);
コード例 #10
0
 static EndpointItem CreateSendingEndpoint(StoredMessage m) => new EndpointItem(m.SendingEndpoint.Name, m.SendingEndpoint.Host, m.SendingEndpoint.HostId, m.GetHeaderByKey(MessageHeaderKeys.Version, null));
コード例 #11
0
 static EndpointItem CreateProcessingEndpoint(StoredMessage m) => new EndpointItem(m.ReceivingEndpoint.Name, m.ReceivingEndpoint.Host, m.ReceivingEndpoint.HostId, m.SendingEndpoint.Equals(m.ReceivingEndpoint) ? m.GetHeaderByKey(MessageHeaderKeys.Version, null) : null);
コード例 #12
0
 public ScrollDiagramItemIntoView(StoredMessage message)
 {
     Message = message;
 }
コード例 #13
0
 static IDictionary StoredMessageToDictionary(StoredMessage storedMessage) => storedMessage.Headers.ToDictionary(h => h.Key, h => h.Value);
コード例 #14
0
 public ReportMessagePackage(Exception ex, StoredMessage message)
 {
     Exception = ex;
     Message = message;
 }
コード例 #15
0
        Handler CreateSendingHandler(StoredMessage message, EndpointItem sendingEndpoint)
        {
            var handler = new Handler(message.GetHeaderByKey(MessageHeaderKeys.RelatedTo, ConversationStartHandlerName), container)
            {
                State = HandlerState.Success,
                Endpoint = sendingEndpoint
            };

            return handler;
        }
コード例 #16
0
 public void Display(StoredMessage selectedMessage)
 {
     SelectedMessage = selectedMessage;
 }
コード例 #17
0
  public bool DisplayPropertiesChanged(StoredMessage focusedMessage) => (focusedMessage == null) ||
 (Status != focusedMessage.Status) ||
 (TimeSent != focusedMessage.TimeSent) ||
 (ProcessingTime != focusedMessage.ProcessingTime) ||
 (ReceivingEndpoint != focusedMessage.ReceivingEndpoint) ||
 (SendingEndpoint != focusedMessage.SendingEndpoint);