Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E2E6B1060B for ; Mon, 16 Sep 2013 10:09:56 +0000 (UTC) Received: (qmail 33731 invoked by uid 500); 16 Sep 2013 10:09:06 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 33294 invoked by uid 500); 16 Sep 2013 10:08:49 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 32814 invoked by uid 99); 16 Sep 2013 10:08:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Sep 2013 10:08:22 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of byteflinger@gmail.com does not designate 216.139.250.139 as permitted sender) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Sep 2013 10:08:18 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VLVSC-0000fA-3q for users@activemq.apache.org; Mon, 16 Sep 2013 02:50:48 -0700 Date: Mon, 16 Sep 2013 02:50:33 -0700 (PDT) From: ByteFlinger To: users@activemq.apache.org Message-ID: <1379325033047-4671515.post@n4.nabble.com> Subject: How to make ActiveMQ libs remember failover settings? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi I have an application which is configured to put a message in a queue using failover to 2 different servers. The idea is that it will always try to send to server1 first and if it fails it should failover and send to server2 instead, until server1 comes up again at which point it should fail back over to server1. The connection string I am using is the following: failover://(tcp://server1:61616,tcp://server2:61616)?timeout=1500&randomize=false&priorityBackup=true I am also not using the JEE connection pool abstract so I am using ActiveMQ's PoolingConnectionFactory instead. The issue here is that, if I bring server1 down, the application correctly fails over to server2 however my issues is that after a certain amount of time has passed rather than sending new messages immediately to server2, it will once again try to connect first to server1 which will take some time to timeout and then swap over to server2. Why does it not remember that server1 is down (specially given the fact that there is a thread in the background trying to check if it is up or down)? How would I fix that? I noticed that the time it takes for it to "forget" this is the time it takes for the connection in the pool to expire. I am guessing that telling the PoolingConnectionFactory to never expire the threads would probably solve the issue but is that the proper solution? What is the impact of having this thread open at all times? Is there a way to tell the pool to open up a default amount of connections by default upon start or is it normal to have the threads open dynamically as producers put messages on them? Any help on the matter is appreciated. -- View this message in context: http://activemq.2283324.n4.nabble.com/How-to-make-ActiveMQ-libs-remember-failover-settings-tp4671515.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.