7 Replies Latest reply on Dec 22, 2011 12:32 AM by simpleram

    configure HornetQ

    simpleram

      Hi, im using 2.2.5-Final to sending a lot of priority messages. With a large number of messages in queue, I noticed (in visualvm) that their processing is performed serially. The size of this stack depends on the speed of consumer. A high-priority messages are sent at the beginning of each stack. Thus the time interval between arrivals high priority messages remain static. Is there a way to control the size of stack (reduction) to achieve a more frequent dispatched high priority messages?

      PS: sorry for my bad eng =)

        • 1. Re: configure HornetQ
          gaohoward

          I think what you need is a faster consumer, is that so? What's your message consumer code looks like?

          • 2. Re: configure HornetQ
            simpleram

            This is a consumer in a test project for research prioritization in a broker with a large number of messages in queue.

             

            <route>

                        <from uri="jms:testPrioritization?concurrentConsumers=2"/>

                        <setExchangePattern pattern="InOut"/>

                        <throttle timePeriodMillis="150">

                            <constant>3</constant>

                           ...

                           collecting statistic

                           ...

                         </throttle>

            </route>

             

            The test showed that  activeMQ over 6000 messages in queue stop dispatched high-priority messages. Then I tried to use hornetq. It works great, and shows a steady job. Configuring timePeriodMillis in throttle, i see that stack changing size dynamically. High priority messages dispatched stable, but after a static period of time. so I want to reduce this stack for more frequent production of high priority messages

            • 3. Re: configure HornetQ
              gaohoward

              Re: "but after a static period of time. so I want to reduce this stack for more frequent production of high priority messages"

               

              Can you tell me how do you measure the 'period' or 'frequency' of the messages?

               

              Howard

              • 4. Re: configure HornetQ
                simpleram

                There are two producer low and hight priority message. Low producer 5000 messages every 10 sec. Hight producer 10 message every 10 sec.

                Consumer receives with starting route this:

                 

                Take first HIGHT priority message

                ....

                Take last HIGHT priority message - here im set time1

                 

                Take first LOW priority message

                .... always ~2500 messages

                Take last LOW priority message

                 

                Take first HIGHT priority message - here im set time2 and see difference with time1

                ....

                Take last HIGHT priority message  - here im set time1

                 

                Take first LOW priority message

                .... always ~2500 messages

                Take last LOW priority message

                 

                Take first HIGHT priority message - here im set time2 and see difference with time1

                ....

                Take last HIGHT priority message  - here im set time1

                ...

                etc.

                Number of low priority messages pack is always static ,and doesn't depend from consumers speed. Time interval (time2-time1) depends from consumers speed ( timePeriodMillis in throttle). But in production (it will be notification system) speed will be static. So im looking any way to get hight priority messages more frequently. Is it real ?

                • 5. Re: configure HornetQ
                  leosbitto

                  Anton Ram wrote:

                   

                  There are two producer low and hight priority message. Low producer 5000 messages every 10 sec. Hight producer 10 message every 10 sec.

                  :

                  :

                  So im looking any way to get hight priority messages more frequently. Is it real ?

                   

                  You could send the high priority messages to one queue and low priority messages to another queue. Then you could program your consumers to receive from the high priority queue more frequently than from the low priority queue.

                  • 6. Re: configure HornetQ
                    gaohoward

                    I think you can try the method suggested by Leos. According to jms 1.1 spec, there is no absolute guarantee that higher priority messages always delivered before lower ones. It's just more likely so.

                     

                    Howard

                    • 7. Re: configure HornetQ
                      simpleram

                      Yes, I know this decision . But I see no reason to use this hardcore method  if hq shows a steady job. What if will require the use of all priority levels in the future? It will be not very an elegant solution.

                      I just wanted to slightly change his job to better fit my purposes. Thanks anyway =)