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);
        }
Example #2
0
 public SagaInvocation(SagaInfo saga, StoredMessage triggeringMessage)
 {
     ID              = saga.SagaId;
     SagaType        = TypeHumanizer.ToName(saga.SagaType);
     IsSagaCompleted = saga.ChangeStatus == "Completed";
     IsSagaInitiated = string.IsNullOrEmpty(triggeringMessage.GetHeaderByKey(MessageHeaderKeys.SagaId)) &&
                       !string.IsNullOrEmpty(triggeringMessage.GetHeaderByKey(MessageHeaderKeys.OriginatedSagaId));
 }
Example #3
0
        string ProcessSagaType(StoredMessage message)
        {
            if (message.Sagas == null)
            {
                return(string.Empty);
            }

            var originatingSaga = message.Sagas.FirstOrDefault();

            if (originatingSaga == null)
            {
                return(string.Empty);
            }

            return(TypeHumanizer.ToName(originatingSaga.SagaType));
        }
        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;
            }
        }
Example #5
0
        public MessageInfo(
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            Func <ExceptionDetailViewModel> exceptionDetailViewModel,
            SequenceDiagramViewModel viewModel,
            StoredMessage message,
            ReactiveList <EndpointInfo> endpoints)
        {
            this.windowManager            = windowManager;
            this.eventAggregator          = eventAggregator;
            this.exceptionDetailViewModel = exceptionDetailViewModel;
            Message   = message;
            Endpoints = endpoints;

            RetryMessageCommand       = viewModel.RetryMessageCommand;
            CopyConversationIDCommand = viewModel.CopyConversationIDCommand;
            CopyMessageURICommand     = viewModel.CopyMessageURICommand;
            SearchByMessageIDCommand  = viewModel.SearchByMessageIDCommand;
            ShowSagaCommand           = viewModel.ShowSagaCommand;
            var cmd = new ReactiveCommand();

            cmd.Subscribe(_ => ShowException());
            DisplayExceptionDetailsCommand = cmd;

            Name = message.FriendlyMessageType;
            if (message.Sagas != null && message.Sagas.Any())
            {
                SagaName = TypeHumanizer.ToName(message.Sagas.First().SagaType);
            }
            CriticalTime   = message.CriticalTime;
            DeliveryTime   = message.DeliveryTime;
            ProcessingTime = message.ProcessingTime;

            ExceptionType    = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
            ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionMessage);

            endpoints.Changed.Subscribe(_ => UpdateIndicies());

            UpdateIndicies();
        }