5 Replies Latest reply on Jan 10, 2011 10:53 AM by clebert.suconic

    producer flow control

    nikhilpal

      I am using hornetq 2.1.2/standalone/non-clustered on a centOS box.

       

      Here is the settings from configuration file

       

           <address-setting match="#">

               <dead-letter-address>jms.queue.DLQ</dead-letter-address>

               <expiry-address>jms.queue.ExpiryQueue</expiry-address>

               <redelivery-delay>0</redelivery-delay>

               <max-size-bytes>1048576</max-size-bytes>

               <message-counter-history-day-limit>10</message-counter-history-day-limit>

               <address-full-policy>BLOCK</address-full-policy>

            </address-setting>

         </address-settings>

       

      I run a producers which is publishing messages on a queue (large number of messages). Each message is around ~1mb as I am putting a setting a large text as part of the body. I assume that after running for few cycles the producer should block and not keep publishing messages, but alas doesn't happen it keeps running forever.

       

      Any clues/ideas of why I am seeing this behaviour, interestingly I started jconsole and watched the hornetq memory usage and that didnt increase as well. And to confirm whether messages are going in the queue I looked at the MBean and confirmed the message count was increasing !!

       

       

       

           <address-setting match="#">
               <dead-letter-address>jms.queue.DLQ</dead-letter-address>
               <expiry-address>jms.queue.ExpiryQueue</expiry-address>
               <redelivery-delay>0</redelivery-delay>
               <max-size-bytes>1048576</max-size-bytes>
               <message-counter-history-day-limit>10</message-counter-history-day-limit>
               <address-full-policy>BLOCK</address-full-policy>
            </address-setting>
         </address-settings>
        • 1. producer flow control
          clebert.suconic

          Large Messages will not use any memory on the server, hence you won't have the large body used on the block counts.

           

          The hearders and properties wiill be taken into account but not the file that's on the server.

           

           

          BTW: Producer Flow control is a different thing. This is aboug blocking policy to avoid OMEs. (Instead of paging).

          • 2. producer flow control
            nikhilpal

            Thanks for the reply Clebert.

             

            - What I am trying to achieve is the blocking policy of HornetQ. As per the documentation 19.2.1.3. Blocking producer window based flow control,

            I am trying to recreate a scenario "When the address gets full, producers will block on the client side"


            For reproducing this scenario I did the following reduced the <max-size-bytes>1048576</max-size-bytes> and then had a producer produce messages without a corresponding consumer.


            I assumed that after sometime the address will get full and my producer would block.

             

            But after running the experiment few times I couldnt reproduce the scenario, hence this post.

             

            Any ideas would be helpful.

             

            Cheers

            • 3. Re: producer flow control
              clebert.suconic

              Address full is different from flow control

               

               

              Flow control = avoiding exaustion on the channel.

               

              Blocking = avoiding OME at the server for the messages that are being held in memory.

               

               

              on that case, large messages are not stored in memory, hence only their header is counted on the blocking count (post edited this by Clebert)

              • 4. producer flow control
                nikhilpal

                Thanks for the clarification Clebert, that makes sense.

                 

                Can you define "large" ? Is there any config/documentation which defines the value.

                • 5. producer flow control
                  clebert.suconic

                  large is defined by min-large-message on the connection-factory. Look at the large message chapter..

                   

                  let me know if you have more questions.