コード例 #1
0
        public QueueMessagesVisualization get_messages_Port_QueueName(MessagesInputModel input)
        {
            var request = new QueueMessageRetrievalRequest
            {
                Port = input.Port,
                QueueName = input.QueueName
            };

            var messages = _queueMessageRetrieval.GetAllMessagesInQueue(request).Select(msg =>
            {
                var summary = new MessageSummary
                {
                    id = msg.Id.ToString(),
                    status = msg.Status.ToString(),
                    sentat = msg.SentAt.ToString(),
                    sourceinstanceid = msg.Id.SourceInstanceId.ToString(),
                    headers = msg.Headers.ToDictionary()
                };

                if (msg is PersistentMessageToSend)
                {
                    summary.destination = msg.As<PersistentMessageToSend>().Endpoint.ToString();
                }

                return summary;
            }).ToArray();

            return new QueueMessagesVisualization
            {
                Port = input.Port,
                QueueName = input.QueueName,
                Messages = messages
            };
        }
コード例 #2
0
        public QueueMessagesVisualization get_messages_Port_QueueName(MessagesInputModel input)
        {
            var request = new QueueMessageRetrievalRequest
            {
                Port      = input.Port,
                QueueName = input.QueueName
            };

            var messages = _queueMessageRetrieval.GetAllMessagesInQueue(request).Select(msg =>
            {
                var summary = new MessageSummary
                {
                    id               = msg.Id.ToString(),
                    sentat           = msg.SentAt.ToString(),
                    sourceinstanceid = msg.Id.SourceInstanceId.ToString(),
                    headers          = msg.Headers
                };

                if (msg is OutgoingMessage)
                {
                    summary.destination = msg.As <OutgoingMessage>().Destination.ToString();
                }


                return(summary);
            }).ToArray();

            return(new QueueMessagesVisualization
            {
                Port = input.Port,
                QueueName = input.QueueName,
                Messages = messages
            });
        }
コード例 #3
0
        private Message retrieveMessage(MessageId messageId, int port, string queueName)
        {
            var request = new QueueMessageRetrievalRequest
            {
                Port      = port,
                QueueName = queueName,
                MessageId = new MessageId
                {
                    MessageIdentifier = messageId.MessageIdentifier,
                    SourceInstanceId  = messageId.SourceInstanceId
                }
            };

            return(_queueMessageRetrieval.GetSingleMessageInQueue(request));
        }
コード例 #4
0
 private IQueueManager GetQueueManager(QueueMessageRetrievalRequest request)
 {
     return _queues.AllQueueManagers.Single(x => x.Endpoint.Port == request.Port);
 }
コード例 #5
0
 public PersistentMessage GetSingleMessageInQueue(QueueMessageRetrievalRequest request)
 {
     return MessageRetrievalStrategies
         .First(x => x.CanHandle(request))
         .ExecuteForSingleMessage(request, GetQueueManager(request));
 }
コード例 #6
0
 public IEnumerable<PersistentMessage> GetAllMessagesInQueue(QueueMessageRetrievalRequest request)
 {
     return MessageRetrievalStrategies
         .First(x => x.CanHandle(request))
         .Execute(request, GetQueueManager(request));
 }
コード例 #7
0
 private Queue GetQueueManager(QueueMessageRetrievalRequest request)
 {
     return(_queues.AllQueueManagers.Single(x => x.Endpoint.Port == request.Port));
 }
コード例 #8
0
 public Message GetSingleMessageInQueue(QueueMessageRetrievalRequest request)
 {
     return(MessageRetrievalStrategies
            .First(x => x.CanHandle(request))
            .ExecuteForSingleMessage(request, GetQueueManager(request)));
 }
コード例 #9
0
 public IEnumerable <Message> GetAllMessagesInQueue(QueueMessageRetrievalRequest request)
 {
     return(MessageRetrievalStrategies
            .First(x => x.CanHandle(request))
            .Execute(request, GetQueueManager(request)));
 }
コード例 #10
0
        private PersistentMessage retrieveMessage(MessageId messageId, int port, string queueName)
        {
            var request = new QueueMessageRetrievalRequest
            {
                Port = port,
                QueueName = queueName,
                MessageId = new MessageId
                {
                    MessageIdentifier = messageId.MessageIdentifier,
                    SourceInstanceId = messageId.SourceInstanceId
                }
            };

            return _queueMessageRetrieval.GetSingleMessageInQueue(request);
        }