MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  QueueBrowser vs MessageConsumer

    Posted Tue September 27, 2022 11:05 AM

    Dear Team,

    When we compare QueueBrowser with MessageConsumer, QueueBrowser is very slow.
    QueueBrowser is taking approx 1 min to process 100 messages where as consumer is processing ~840 messages.

    This mush difference is expected? can you please suggest if anything needs to be changed in the below code:

    queueEnum = queueBrowserIn.GetEnumerator();
               
                    while (true)
                    {
                        if (queueEnum.MoveNext())
                        {
                            messageCount++;
                            LogWrite($"Message No - {messageCount} - Method: ProcessNewMesage" + DateTime.Now);
    
    
    
                            IBytesMessage bytesMessage = queueEnum.Current as IBytesMessage;
                            if (bytesMessage != null)
                            {
                                byte[] arrayMessage = new byte[bytesMessage.BodyLength];
                                bytesMessage.ReadBytes(arrayMessage);
                                string message = System.Text.Encoding.Default.GetString(arrayMessage);
    
                               
                            }                    
                           
                        }
                        
                    }


    ------------------------------
    Balaji Patil
    ------------------------------


  • 2.  RE: QueueBrowser vs MessageConsumer

    Posted Thu September 29, 2022 05:33 AM
    Even your higher quoted rate is only 14 msg/sec which is an incredibly low rate for MQ, unless the messages are massive.
    There are significant differences between a browse and a destructive get, for example the pass to waiting getter optimization cannot be used when browse is in operation, but your message rates are so low, even in the better case, that it suggests you've got a much bigger issue someplace.

    ------------------------------
    Andrew Hickson
    ------------------------------



  • 3.  RE: QueueBrowser vs MessageConsumer

    Posted Fri September 30, 2022 02:10 AM
    As Andy was saying the numbers which you are mentioning are way too low for both BROWSE & GET. What is the size of the message and how are you calculating the time ?

    ------------------------------
    Ram Subba Rao Chalamalasetti
    ------------------------------



  • 4.  RE: QueueBrowser vs MessageConsumer

    Posted Fri September 30, 2022 08:29 AM
    You need to compare what is comparable. You cannot compare the browse to the destructive get while running both. If you are running both, the messages you are trying to browse are being consumed right away and you have a hard time browsing anything. On top of that you are scanning the queue every 5 seconds for the browse cursor to refresh... not ideal at the message rate you're seeing...
    On the other hand, I would not trust the encoding.default to transform the bytes to a string... Check the message's ccsid...
    If the message format is MQFMT_STRING, let MQ do the conversion to string by casting to a TextMessage...
    Hope it helps...

    ------------------------------
    Francois Brandelik
    ------------------------------