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 }; }
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 }); }
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)); }
private IQueueManager GetQueueManager(QueueMessageRetrievalRequest request) { return _queues.AllQueueManagers.Single(x => x.Endpoint.Port == request.Port); }
public PersistentMessage GetSingleMessageInQueue(QueueMessageRetrievalRequest request) { return MessageRetrievalStrategies .First(x => x.CanHandle(request)) .ExecuteForSingleMessage(request, GetQueueManager(request)); }
public IEnumerable<PersistentMessage> GetAllMessagesInQueue(QueueMessageRetrievalRequest request) { return MessageRetrievalStrategies .First(x => x.CanHandle(request)) .Execute(request, GetQueueManager(request)); }
private Queue GetQueueManager(QueueMessageRetrievalRequest request) { return(_queues.AllQueueManagers.Single(x => x.Endpoint.Port == request.Port)); }
public Message GetSingleMessageInQueue(QueueMessageRetrievalRequest request) { return(MessageRetrievalStrategies .First(x => x.CanHandle(request)) .ExecuteForSingleMessage(request, GetQueueManager(request))); }
public IEnumerable <Message> GetAllMessagesInQueue(QueueMessageRetrievalRequest request) { return(MessageRetrievalStrategies .First(x => x.CanHandle(request)) .Execute(request, GetQueueManager(request))); }
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); }