You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "tapan.thapa" <ta...@gmail.com> on 2012/06/06 08:11:51 UTC

Re: Queue/Message Fairness as oppose to Client Fairness

Hello,

My requirement is exactly the same which is being discussed in this thread.

I have checked and found that the issue is fixed in version 5.6.

https://issues.apache.org/jira/browse/AMQ-3335

My question is how to configure the same via configuration xml files.

Kindly respond.

Regards
Tapan Thapa

--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4653010.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by "tapan.thapa" <ta...@gmail.com>.
Hello Gtully,

I am sorry but still it is not working as expected.

<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"
maxPageSize="1" lazyDispatch="true" queuePrefetch="1"></policyEntry>

<taskRunnerFactory> 
      <taskRunnerFactory maxIterationsPerRun="1"/> 
    </taskRunnerFactory>

Any other solutions if possible.

If this can not be achieved with ActiveMQ than can you suggest something
else.

Thanks for your prompt support. 

Regards
Tapan Thapa



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654925.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by Gary Tully <ga...@gmail.com>.
What you want goes against the grain a bit, the broker wants to
dispatch messages as fast as it can for each destination.

Using lazyDispatch=true will reduce the queue dispatch loop to what
can be immediately sent, so when that is combined with a low prefetch,
eg prefetch=1, the minimum number of messages per destination will be
processed at a time.


On 8 August 2012 11:32, tapan.thapa <ta...@gmail.com> wrote:
> Hello,
>
> Thanks for the suggestion however i tried with php stomp 1.0 as well as with
> Java client and both are not working as expected.
>
> PHP Client:
> PHP consumer get all messages from first queue than second queue and so on.
>
> Java Client:
> Java client is good as it receives 3-4 messages per queue in round robin.
> sometime 4-5-10 (Can not predict) messages.
>
> However i am expecting 1 message from each queue in round robin (Does not
> matter if consumer is in java or in php).
>
> Settings now are:
>
> <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"
> maxPageSize="1">
>                 </policyEntry>
>               <taskRunnerFactory>
>       <taskRunnerFactory maxIterationsPerRun="1"/>
>     </taskRunnerFactory>
>
> Kindly suggest.
>
> Regards
> Tapan Thapa
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654892.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by "tapan.thapa" <ta...@gmail.com>.
Hello,

Thanks for the suggestion however i tried with php stomp 1.0 as well as with
Java client and both are not working as expected.

PHP Client:
PHP consumer get all messages from first queue than second queue and so on.

Java Client:
Java client is good as it receives 3-4 messages per queue in round robin.
sometime 4-5-10 (Can not predict) messages.

However i am expecting 1 message from each queue in round robin (Does not
matter if consumer is in java or in php).

Settings now are:

<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"
maxPageSize="1">
                </policyEntry>
              <taskRunnerFactory> 
      <taskRunnerFactory maxIterationsPerRun="1"/> 
    </taskRunnerFactory>

Kindly suggest.

Regards
Tapan Thapa



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654892.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by Gary Tully <ga...@gmail.com>.
remove optimizedDispatch, leave it at the default false, otherwise the
send thread is used to dispatch messages.

On 8 August 2012 09:14, tapan.thapa <ta...@gmail.com> wrote:
> Hello,
>
> I have tested this functionality with ActiveMQ 5.6.0 and Java driver as
> well.
>
> Java driver is still better and receiving message from all the queues but
> not at the configured value. I have configured maxIterationsPerRun="1"
> however java consumer is receiving almost 20 sometime 10 message from one
> queue and then from second,third so on queue.
>
> Kindly suggest.
>
> My Settings under activemq.xml are:
> <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"
> optimizedDispatch="true" maxPageSize="1"></policyEntry>
> <taskRunnerFactory>
>       <taskRunnerFactory maxIterationsPerRun="1"/>
>     </taskRunnerFactory>
>
>
> Regards
> Tapan Thapa
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654884.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by "tapan.thapa" <ta...@gmail.com>.
Hello,

I have tested this functionality with ActiveMQ 5.6.0 and Java driver as
well.

Java driver is still better and receiving message from all the queues but
not at the configured value. I have configured maxIterationsPerRun="1"
however java consumer is receiving almost 20 sometime 10 message from one
queue and then from second,third so on queue.

Kindly suggest.

My Settings under activemq.xml are:
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"
optimizedDispatch="true" maxPageSize="1"></policyEntry>
<taskRunnerFactory> 
      <taskRunnerFactory maxIterationsPerRun="1"/> 
    </taskRunnerFactory>
				

Regards
Tapan Thapa



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654884.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by "tapan.thapa" <ta...@gmail.com>.
Hello,

I have downloaded activemq latest snapshot and it seems now PHP stomp 1.0 is
working with latest snap shot.

Now my issue is that taskRunnerFactory is not working as expected.

Scenario:
I have five different queues like htmsl.1,htmsl.2,htmsl.3,htmsl.4 and
htmsl.5 and i have put 500 message in each queue.

Now my single consumer is binding with all the queues like /queue/htmsl.>
however broker send all messages from random queue and then goes to second
random queue and send all the messages and so on.

my activemq.xml is having below taskRunnerFactory settings under broker
settings to achieve 1 message from each queue.

<taskRunnerFactory> 
      <taskRunnerFactory maxIterationsPerRun="1"/> 
    </taskRunnerFactory> 

Kindly suggest why activemq is not sending 1 message from each queue in
round robin.

Thanks in advance.

Regards
Tapan Thapa



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4654879.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by "tapan.thapa" <ta...@gmail.com>.
Many Thanks..

It seems i am about to reach my goal...

However i don't now why php stomp client is throwing error with
apache-activemq-5.6.0 while acknowledging messages where in the same code
was working for apache-activemq-5.5.1.

Still checking PHP Stomp Code available at
http://stomp.fusesource.org/documentation/php/book.html.

Do you have any clue?

Thanks Again.

Regards
Tapan Thapa

--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4653021.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Queue/Message Fairness as oppose to Client Fairness

Posted by Gary Tully <ga...@gmail.com>.
have a peek at the xds (schema) for the xml configuration
search for taskRunnerFactory at
http://activemq.apache.org/schema/core/activemq-core-5.6.0-schema.html
and you will see that it is an element of the broker

so do something like

<broker ...>
  <taskRunnerFactory>
      <taskRunnerFactory maxIterationsPerRun="10"/>
    </taskRunnerFactory>
  ...
</broker>

On 6 June 2012 07:11, tapan.thapa <ta...@gmail.com> wrote:
> Hello,
>
> My requirement is exactly the same which is being discussed in this thread.
>
> I have checked and found that the issue is fixed in version 5.6.
>
> https://issues.apache.org/jira/browse/AMQ-3335
>
> My question is how to configure the same via configuration xml files.
>
> Kindly respond.
>
> Regards
> Tapan Thapa
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p4653010.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com