-
1. Re: configure HornetQ
gaohoward Dec 20, 2011 2:41 AM (in response to simpleram)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 Dec 20, 2011 4:07 AM (in response to gaohoward)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 Dec 20, 2011 8:06 AM (in response to simpleram)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 Dec 21, 2011 3:02 AM (in response to gaohoward)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 Dec 21, 2011 8:40 AM (in response to simpleram)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 Dec 21, 2011 9:51 PM (in response to leosbitto)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 Dec 22, 2011 12:32 AM (in response to gaohoward)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 =)