Azure SubscriptionClient.PeekBatch

I am trying to use Azure SubscriptionClient.PeekBatch (int count) to peek into posts. Everything works fine for counter values ​​0 - 9, but as soon as I enter a value> 9, I only get 9 messages, approx. 30 in the subscription. Is this a mistake, or am I doing something wrong? Sample code below;

private void PeekQueue(){
  SubscriptionClient subscriptionClient = SubscriptionClient.CreateFromConnectionString(ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString.Test.Peek"], "InHvccc", "lmo");
  IEnumerable<BrokeredMessage> messages;
  lstMessages.Items.Clear();
  messages = subscriptionClient.PeekBatch(int.Parse(txtPeekCount.Text));
  foreach(BrokeredMessage bm in messages) {
    lstMessages.Items.Add(bm.GetBody<LmoMessage>());
  }
  subscriptionClient.Close();
}

Greetings to Ragu

+4
source share
1 answer

Based on this answer (the topic is different, but a nice explanation about the client and caching), I would try a little bit to play with the cache:

  • using PeekBacth (0, 30)
  • restart the application and try again.
  • restart the cloud service and try again.
  • , , , (, 3, 10 - 5)
+2

Source: https://habr.com/ru/post/1532414/


All Articles