You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dcheckoway <dc...@gmail.com> on 2011/04/12 21:35:59 UTC

Force a failover re-randomize?

I've got producers set up to randomize to my broker nodes, such as:

failover:(tcp://mq01:61616,tcp://mq02:61616)?randomize=true

Let's say the connection pool is set to max=10.  Normally you'd see
"roughly" (randomly) 50/50 distribution to the two brokers, say 5 connected
to mq01, and 5 connected to mq02.  That works great, no complaints.

Now I restart activemq on mq01.  The producers happily continue along,
failing over to mq02.  So now all 10 connections in the pool are connected
to mq02.  That's cool, expected.  But once mq01 comes back online, it sits
idle unless/until I restart my producers.

Thus my question.  Is there a way to force my producers to "re-randomize"
their connections?  I'd love to be able to push a button and -- seamlessly,
of course -- have the connection pool reconnect just as they would at
first-connect time.

Possible?  Wish list enhancement?

-----
Dan Checkoway
dcheckoway gmail com
--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3445497.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: Force a failover re-randomize?

Posted by "Swindells, Thomas" <TS...@nds.com>.
How does that work - if each broker is standalone then when the producers fail over they will start communicating with a server with a totally different set of messages and conversation state, I don't understand how this would work or be useful?

> -----Original Message-----
> From: dcheckoway [mailto:dcheckoway@gmail.com]
> Sent: 12 April 2011 22:42
> To: users@activemq.apache.org
> Subject: Re: Force a failover re-randomize?
>
> I should have mentioned...ActiveMQ 5.4.2/5.5.0, and I'm *not* using
> network
> of brokers.  Each broker is totally standalone.
>
> -----
> Dan Checkoway
> dcheckoway gmail com
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-
> tp3445497p3445758.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************

Re: Force a failover re-randomize?

Posted by dcheckoway <dc...@gmail.com>.
I should have mentioned...ActiveMQ 5.4.2/5.5.0, and I'm *not* using network
of brokers.  Each broker is totally standalone.

-----
Dan Checkoway
dcheckoway gmail com
--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3445758.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Force a failover re-randomize?

Posted by nnprasad <NN...@dwd.IN.gov>.
Hi,

I think you can use updateClusterClients="true" and
rebalanceClusterClients="true" options in your  tag. provided if you are
using 5.4.X

Thank You,
Nag.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3445529.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Force a failover re-randomize?

Posted by dcheckoway <dc...@gmail.com>.
Ah, yup, there it is.  Too easy.  Thanks for the tip!


Gary Tully wrote:
> 
> its on the connection pool, have a peek at the test:
> http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java?view=markup
> 


-----
Dan Checkoway
dcheckoway gmail com
--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3448603.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Force a failover re-randomize?

Posted by Gary Tully <ga...@gmail.com>.
replace "network" with "cluster" or "master/slave pairs" or
"collection" it does not make any difference. The enhancement is that
a connection in a pool will get a chance to be randomized again by the
failover transport.

The relationship between the brokers, if any, is independent.

On 13 April 2011 16:03, nnprasad <NN...@dwd.in.gov> wrote:
> The link which Gary gave..saying
>
> "It might make sense to restrict the lifetime of connections in a connection
> pool, so that once in a while the connection is refreshed providing a chance
> of connection load balancing over a network of brokers."
>
> and here the main poster of this message told that he is *not* using the
> network of brokers
>
>
> I am confused. Please explain in your leisure.
>
> Thank You
> Nag.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3447393.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



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

Re: Force a failover re-randomize?

Posted by nnprasad <NN...@dwd.IN.gov>.
The link which Gary gave..saying 

"It might make sense to restrict the lifetime of connections in a connection
pool, so that once in a while the connection is refreshed providing a chance
of connection load balancing over a network of brokers."

and here the main poster of this message told that he is *not* using the
network of brokers


I am confused. Please explain in your leisure.

Thank You
Nag.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3447393.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Force a failover re-randomize?

Posted by Gary Tully <ga...@gmail.com>.
its on the connection pool, have a peek at the test:
http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java?view=markup

On 13 April 2011 11:38, dcheckoway <dc...@gmail.com> wrote:
> Thanks Gary.  That should do the trick!  I don't see it doc'd on the failover
> or tcp transport wiki pages, though.  Does expiryTimeout apply to failover:
> or tcp:?  Sorry to be ignorant about features that have been in there a
> while, just haven't run across this one.
>
> -----
> Dan Checkoway
> dcheckoway gmail com
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3446792.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



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

Re: Force a failover re-randomize?

Posted by dcheckoway <dc...@gmail.com>.
Thanks Gary.  That should do the trick!  I don't see it doc'd on the failover
or tcp transport wiki pages, though.  Does expiryTimeout apply to failover:
or tcp:?  Sorry to be ignorant about features that have been in there a
while, just haven't run across this one.

-----
Dan Checkoway
dcheckoway gmail com
--
View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3446792.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Force a failover re-randomize?

Posted by Gary Tully <ga...@gmail.com>.
have a look at https://issues.apache.org/jira/browse/AMQ-2376, the
expiryTimeout attribute may be what you need as this can be used to
limit the lifetime of a connection in the pool.

On 12 April 2011 20:35, dcheckoway <dc...@gmail.com> wrote:
> I've got producers set up to randomize to my broker nodes, such as:
>
> failover:(tcp://mq01:61616,tcp://mq02:61616)?randomize=true
>
> Let's say the connection pool is set to max=10.  Normally you'd see
> "roughly" (randomly) 50/50 distribution to the two brokers, say 5 connected
> to mq01, and 5 connected to mq02.  That works great, no complaints.
>
> Now I restart activemq on mq01.  The producers happily continue along,
> failing over to mq02.  So now all 10 connections in the pool are connected
> to mq02.  That's cool, expected.  But once mq01 comes back online, it sits
> idle unless/until I restart my producers.
>
> Thus my question.  Is there a way to force my producers to "re-randomize"
> their connections?  I'd love to be able to push a button and -- seamlessly,
> of course -- have the connection pool reconnect just as they would at
> first-connect time.
>
> Possible?  Wish list enhancement?
>
> -----
> Dan Checkoway
> dcheckoway gmail com
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Force-a-failover-re-randomize-tp3445497p3445497.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



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