<div dir="ltr"><div> private int handledMessages;<br></div><div><br></div><div>clusteringMessageBroker.Subscribe(</div><div>               clusteringOutputQueueName, ProcessMessage, typeof(ClusteringOutputMessage));</div><div>Thread.Sleep(380000);<br></div><div>clusteringMessageBroker.Unsubscribe(clusteringOutputQueueName, ProcessMessage);<br></div><div><br></div><div><div>private void ProcessMessage(object message)</div><div>        {</div><div>            clusteringMessage = (ClusteringOutputMessage)message;</div><div>            log.InfoFormat("add message {0}", clusteringMessage.UpdatedClusters.Count());</div><div>            handledMessages++;</div><div>            log.InfoFormat("Consumed {0} messages ", handledMessages);</div><div>            log.InfoFormat("ConsumedMessage {0}", handledMessages);</div><div><br></div><div>            var cluster = clusteringMessage.UpdatedClusters;</div><div>            var updatedClusters = cluster.Select(</div><div>                c =></div><div>                new ClusteringOutputMessage.Cluster</div><div>                    {</div><div>                        Id = c.Id,</div><div>                        MainArticleId = c.MainArticleId,</div><div>                        ArticlesIds = c.ArticlesIds</div><div>                    }).ToList();</div><div><br></div><div>            foreach (var updatedCluster in updatedClusters)</div><div>            {</div><div>                log.InfoFormat("id {0}", updatedCluster.Id);</div><div>                log.InfoFormat("mainid {0}", updatedCluster.MainArticleId);</div><div>                foreach (var articleId in updatedCluster.ArticlesIds)</div><div>                {</div><div>                    log.InfoFormat("ArticleId {0}", articleId);</div><div>                }</div><div>            }</div><div>        }</div></div><div><br></div><div>I want to sibscribing clusteringOutputQueueName, but listening to the queue happens once in stages, according to several reports, and it turns out that the cycle runs several times and can not count the number of clusters.</div><div>I want to count updatedCluster.Id and i want to compare updatedCluster.ArticlesIds with the known value.</div><div>Help me please!</div></div>