public void GetMessageById() { var expectedBody = "testGetById"; var messageId = queue.Post(expectedBody); Assert.AreEqual(expectedBody, queue.Get(messageId).Body); }
private async Task updateItems() { var collection = await QueueClient.Get(); if ((collection != null) && (collection.Entries != null)) { var active = collection.Entries.FirstOrDefault(q => q.RecordingStatus == RecordingStatus.Started); if ((active == null) && collection.Entries.Any()) { active = collection.Entries.OrderBy(r => r.Created).FirstOrDefault(); } var serverCollection = collection.Entries.ToList(); if ((active != null) && serverCollection.Contains(active)) { serverCollection.Remove(active); } if (Items == null) { Items = new ObservableCollection <RecordQueueItem>(); } int previousItemsCount = Items.Count; if (activeRecording != null) { previousItemsCount++; } var newItems = await Items.UpdateItems(serverCollection.Where(q => q.RecordingStatus != RecordingStatus.Started).OrderBy(q => q.Rank)); if (((active == null) || (activeRecording == null)) || (activeRecording.ID != active.ID)) { ActiveRecording = active; } if (ActiveRecording != null) { await loadStatusAsync(ActiveRecording); } var items = Items.ToList(); if ((SelectedItem != null) && !items.Any(r => r.ID == SelectedItem.ID) && (SelectedItem != ActiveRecording)) { SelectedItem = null; } if (!collection.Entries.Any()) { NewItemsCount = 0; } else if ((previousItemsCount < collection.Entries.Count()) && (cloudViewModel.SelectedItem != CloudItem.Queue)) { NewItemsCount = collection.Entries.Count(); } OnPropertyChanged(nameof(ItemsCount)); } }
public int ObterProximo(string nomeDaFila, string parametro) { var configuracaoIp = this.configuracaoIpRepositorio.ObterConfiguracaoDaFila(); var clienteFila = new QueueClient( configuracaoIp.Host, configuracaoIp.Porta); return(clienteFila.Get(nomeDaFila, parametro)); }
public int ObterProximo() { var configuracaoIp = this.configuracaoIpRepositorio.ObterConfiguracaoDaFila(); var clienteFila = new QueueClient( configuracaoIp.Host, configuracaoIp.Porta); return(clienteFila.Get("ni")); }
public async Task <MessageIdCollection> ResendFailedMessages(CancellationToken cancellationToken, int?limit = null) { QueueInfo queueInfo = await _queueClient.Info(); string errorQueueName = queueInfo.ErrorQueue; var result = new MessageIdCollection(); if (string.IsNullOrEmpty(errorQueueName)) { return(result); } QueueClient errorQ = _client.IronMqClient.Queue(errorQueueName); QueueMessage next; int count = 0; while (errorQ.Read(out next)) { if (cancellationToken.IsCancellationRequested || (limit.HasValue && count >= limit.Value)) { break; } var errorQueueMessage = next.ReadValueAs <ErrorQueueMessage>(); QueueMessage originalMsg = await _queueClient.Get(errorQueueMessage.SourceMessageId); string messageId = await _queueClient.Post(originalMsg); result.Ids.Add(messageId); if (!string.IsNullOrEmpty(messageId)) { await next.Delete(); } count++; } result.Message = "Messages put on queue."; return(result); }
private async Task loadDetailsAsync(RecordQueueItem item) { try { var details = await QueueClient.Get(item.ID); if (details != null) { item.UpdateFromDetails(details); } } catch (Exception ex) { //XXX : Handle error LoggerService.Instance.Log("ERROR: Queue.loadDetailsAsync: " + ex); } }