You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by joe smith <wa...@yahoo.com> on 2011/09/08 23:58:11 UTC

Could not start connection when using jms.prefetchPolicy on failover protocol url

Could not start connection when using the following URL pattern:

failover:(tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1,tcp://localhost:62616?jms.prefetchPolicy.queuePrefetch=1)

When prefetchPolicy is removed, connection started normally.

Broker version: 5.4.2
Java client library
JVM 1.6

We do not access to the client code and can only pass in configs via url.

Thanks for any help.

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Joe Smith <jo...@yahoo.com>.
Hi Gary,

Thanks.  I tried the decreaseNetworkConsumerPriority - still the msgs were being routed to the other 2 brokers.  I think the combination of a busy local consume with a low prefetchPolicy may be forcing the messages to the other brokers.  I've also tried the TTL and round-robin dispatch policy (to force an even distribution).  Producer sends to virutal topic, consumers reads from Consumer.* queue.  But we still see the same behavior.  It could be that the ack from the remote consumer to track the actual size of the remote prefetch buffer is not in sync.  Sorry - don't know enough about the code to pin it down.

Thanks, again.



________________________________
From: Gary Tully <ga...@gmail.com>
To: users@activemq.apache.org; Joe Smith <jo...@yahoo.com>
Sent: Friday, September 16, 2011 11:38 AM
Subject: Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

the prefetch on a network connector does not know about the load on
the remote broker. A network   connector is just another consumer, it
simply turns a message dispatch into a send to the remote broker. So
the only way to restrict the movement of messages across the network
would be producer flow control based on a memory limit on the remote
broker.

You can make network connectors have a lower priority,
decreaseNetworkConsumerPriority=true but if all local consumers are
busy, the lower priority network connector will get messages.

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Gary Tully <ga...@gmail.com>.
the prefetch on a network connector does not know about the load on
the remote broker. A network   connector is just another consumer, it
simply turns a message dispatch into a send to the remote broker. So
the only way to restrict the movement of messages across the network
would be producer flow control based on a memory limit on the remote
broker.

You can make network connectors have a lower priority,
decreaseNetworkConsumerPriority=true but if all local consumers are
busy, the lower priority network connector will get messages.

On 16 September 2011 15:58, Joe Smith <jo...@yahoo.com> wrote:
> Hi Gary,
>
> Yes, we saw in the debug logs that remote consumer and subscription are added to the local broker.  We noticed the prefetch count was 1000, instead of 1 on the consumer's uri.  We added the prefetchSize to the networkConnector, but still the same result.  When we use consumers that consume messages quickly - the cluster load balanced evenly.  However, when we made the processing from 1 to 20 secs (via a parameter in each message), the broker where the producer is connected and when the consumer on that broker was busy already, the broker seems to directed the message to the other brokers - even if the consumers on the other brokers were busy/processing as well.
>
> Really appreciate you and all the folks who are helping.  Hope some of this feedback will help.
>
> Thanks
>
>
> ________________________________
> From: Gary Tully <ga...@gmail.com>
> To: users@activemq.apache.org; Joe Smith <jo...@yahoo.com>
> Sent: Friday, September 16, 2011 5:56 AM
> Subject: Re: Could not start connection when using jms.prefetchPolicy on failover protocol url
>
> note that there is a perfetch configuration option on a networkConnector.



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

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Joe Smith <jo...@yahoo.com>.
Hi Gary,

Yes, we saw in the debug logs that remote consumer and subscription are added to the local broker.  We noticed the prefetch count was 1000, instead of 1 on the consumer's uri.  We added the prefetchSize to the networkConnector, but still the same result.  When we use consumers that consume messages quickly - the cluster load balanced evenly.  However, when we made the processing from 1 to 20 secs (via a parameter in each message), the broker where the producer is connected and when the consumer on that broker was busy already, the broker seems to directed the message to the other brokers - even if the consumers on the other brokers were busy/processing as well.

Really appreciate you and all the folks who are helping.  Hope some of this feedback will help.

Thanks


________________________________
From: Gary Tully <ga...@gmail.com>
To: users@activemq.apache.org; Joe Smith <jo...@yahoo.com>
Sent: Friday, September 16, 2011 5:56 AM
Subject: Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

note that there is a perfetch configuration option on a networkConnector.

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Gary Tully <ga...@gmail.com>.
note that there is a perfetch configuration option on a networkConnector.

On 15 September 2011 22:48, Joe Smith <jo...@yahoo.com> wrote:
> Hi Johan,
>
>
> Thanks for the info - placing the prefetch on the failover worked.  I put the prefetch on the tcp: based on the page at http://activemq.apache.org/what-is-the-prefetch-limit-for.html.
>
>
> The failover page dose not reference prefetch option: http://activemq.apache.org/failover-transport-reference.html.
> Thanks,
>  again.
>
>
> Unfortunately the behavior seem to be the same when we have 3 brokers in a cluster with 1 producer and 4 consumers (each consumer connected to a separate broker - except the 4th which connected to the same broker as consumer 1).   When producer sends msgs, most of the msgs got distributed to consumers to 2 of the 3 brokers.
>
>
> The msgs took different amount of time to process - even with prefetch - I see one broker processed 1 msg and sits idle, where messages were queued up on the other 3 consumers.  I thought the prefetch is supposed to distribute the message to who ever is free to process (empty prefetch buffer), but the behavior was showing msgs gets queued up behind each consumer regardless - so some sit idle while another has msgs queued up.
>
>
> The distribution was round-robin 1 to each consumer - favoriting consumers on 2 brokers out of 3.  In multiple runs, consumer on broker 2 always get 1msg out of 30 sent.  Broker 2 happened to where the producer is connected.  The pattern seems to suggest if local the consumer on the broker where the producer is connected, the broker forwards msgs to the other brokers - regardless if consumers other brokers are busy as well.  Prefetch does not seem to work across cluster.  I tried with both sync and async receive, I placed prefetchSize=1 on networkConnector  - same behavior.
>
>
> Thanks
>
>
> ________________________________
> From: Johan Edstrom <se...@gmail.com>
> To: "users@activemq.apache.org" <us...@activemq.apache.org>
> Sent: Thursday, September 8, 2011 8:50 PM
> Subject: Re: Could not start connection when using jms.prefetchPolicy on failover protocol url
>
> You need to have the options outside the parentheses, there should be samples on the failover uri page.
>



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

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Joe Smith <jo...@yahoo.com>.
Hi Johan,


Thanks for the info - placing the prefetch on the failover worked.  I put the prefetch on the tcp: based on the page at http://activemq.apache.org/what-is-the-prefetch-limit-for.html.  


The failover page dose not reference prefetch option: http://activemq.apache.org/failover-transport-reference.html.
Thanks,
 again.


Unfortunately the behavior seem to be the same when we have 3 brokers in a cluster with 1 producer and 4 consumers (each consumer connected to a separate broker - except the 4th which connected to the same broker as consumer 1).   When producer sends msgs, most of the msgs got distributed to consumers to 2 of the 3 brokers.  


The msgs took different amount of time to process - even with prefetch - I see one broker processed 1 msg and sits idle, where messages were queued up on the other 3 consumers.  I thought the prefetch is supposed to distribute the message to who ever is free to process (empty prefetch buffer), but the behavior was showing msgs gets queued up behind each consumer regardless - so some sit idle while another has msgs queued up.


The distribution was round-robin 1 to each consumer - favoriting consumers on 2 brokers out of 3.  In multiple runs, consumer on broker 2 always get 1msg out of 30 sent.  Broker 2 happened to where the producer is connected.  The pattern seems to suggest if local the consumer on the broker where the producer is connected, the broker forwards msgs to the other brokers - regardless if consumers other brokers are busy as well.  Prefetch does not seem to work across cluster.  I tried with both sync and async receive, I placed prefetchSize=1 on networkConnector  - same behavior.


Thanks


________________________________
From: Johan Edstrom <se...@gmail.com>
To: "users@activemq.apache.org" <us...@activemq.apache.org>
Sent: Thursday, September 8, 2011 8:50 PM
Subject: Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

You need to have the options outside the parentheses, there should be samples on the failover uri page.

Re: Could not start connection when using jms.prefetchPolicy on failover protocol url

Posted by Johan Edstrom <se...@gmail.com>.
You need to have the options outside the parentheses, there should be samples on the failover uri page.


On Sep 8, 2011, at 17:58, joe smith <wa...@yahoo.com> wrote:

> Could not start connection when using the following URL pattern:
> 
> failover:(tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1,tcp://localhost:62616?jms.prefetchPolicy.queuePrefetch=1)
> 
> When prefetchPolicy is removed, connection started normally.
> 
> Broker version: 5.4.2
> Java client library
> JVM 1.6
> 
> We do not access to the client code and can only pass in configs via url.
> 
> Thanks for any help.