Пример #1
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));
 }
        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);
        }
Пример #3
0
 public MessageNode(IMessageFlowViewModel owner, StoredMessage message)
 {
     Owner            = owner;
     Bounds           = new Rect(100, 100, 203, 40);
     ZOrder           = 1;
     Data             = message;
     IsResizable      = false;
     ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
 }
        Handler CreateSendingHandler(StoredMessage message, EndpointItem sendingEndpoint)
        {
            var handler = new Handler(message.GetHeaderByKey(MessageHeaderKeys.RelatedTo, ConversationStartHandlerName), container)
            {
                State    = HandlerState.Success,
                Endpoint = sendingEndpoint
            };

            return(handler);
        }
Пример #5
0
        public MessageNode(IMessageFlowViewModel owner, StoredMessage message)
        {
            IsResizable      = false;
            Owner            = owner;
            Data             = message;
            ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
            SagaType         = ProcessSagaType(message);

            heightNoEndpoints += HasSaga ? 10 : 0;
            Bounds             = new Rect(0, 0, 203, heightNoEndpoints);
        }
Пример #6
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();
        }
Пример #7
0
        public MessageNode(MessageFlowViewModel owner, StoredMessage message)
        {
            IsResizable      = false;
            Owner            = owner;
            Data             = message;
            ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
            SagaType         = ProcessSagaType(message);

            heightNoEndpoints += HasSaga ? 10 : 0;
            Bounds             = new Rect(0, 0, 100, heightNoEndpoints);

            CopyConversationIDCommand = owner.CopyConversationIDCommand;
            CopyMessageURICommand     = owner.CopyMessageURICommand;
            SearchByMessageIDCommand  = owner.SearchByMessageIDCommand;
            RetryMessageCommand       = owner.RetryMessageCommand;

            message.ChangedProperty(nameof(StoredMessage.Status)).Subscribe(_ =>
            {
                OnPropertyChanged("HasFailed");
                OnPropertyChanged("HasRetried");
            });
        }
Пример #8
0
        public MessageNode(MessageFlowViewModel owner, StoredMessage message)
        {
            IsResizable = false;
            Owner = owner;
            Data = message;
            ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
            SagaType = ProcessSagaType(message);

            heightNoEndpoints += HasSaga ? 10 : 0;
            Bounds = new Rect(0, 0, 203, heightNoEndpoints);

            CopyConversationIDCommand = owner.CopyConversationIDCommand;
            CopyMessageURICommand = owner.CopyMessageURICommand;
            SearchByMessageIDCommand = owner.SearchByMessageIDCommand;
            RetryMessageCommand = owner.RetryMessageCommand;

            message.ObservableForProperty(m => m.Status).Subscribe(_ =>
            {
                OnPropertyChanged("HasFailed");
                OnPropertyChanged("HasRetried");
            });
        }
 public MessageTreeNode(StoredMessage msg)
 {
     Message = msg;
     Parent  = msg.GetHeaderByKey(MessageHeaderKeys.RelatedTo, null);
 }
 private static EndpointItem CreateSendingEndpoint(StoredMessage m)
 {
     return(new EndpointItem(m.SendingEndpoint.Name, m.SendingEndpoint.Host, m.SendingEndpoint.HostId, m.GetHeaderByKey(MessageHeaderKeys.Version, null)));
 }
 private static EndpointItem CreateProcessingEndpoint(StoredMessage m)
 {
     return(new EndpointItem(m.ReceivingEndpoint.Name, m.ReceivingEndpoint.Host, m.ReceivingEndpoint.HostId, m.SendingEndpoint.Equals(m.ReceivingEndpoint) ? m.GetHeaderByKey(MessageHeaderKeys.Version, null) : null));
 }
Пример #12
0
        string GetMajorVersion(StoredMessage message)
        {
            var version = message.GetHeaderByKey(MessageHeaderKeys.Version);

            return(version?.Split('.').First());
        }