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 A04759F91 for ; Tue, 7 Feb 2012 08:33:30 +0000 (UTC) Received: (qmail 84979 invoked by uid 500); 7 Feb 2012 08:33:28 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 84668 invoked by uid 500); 7 Feb 2012 08:33:08 -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 84658 invoked by uid 99); 7 Feb 2012 08:33:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 08:33:02 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Aleksi.Kallio@csc.fi designates 193.166.3.97 as permitted sender) Received: from [193.166.3.97] (HELO smtp2.csc.fi) (193.166.3.97) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 08:32:51 +0000 Received: from kusti.csc.fi (kusti.csc.fi [193.166.0.100]) by smtp2.csc.fi (8.14.3/8.14.3/CSC) with ESMTP id q178WUt9029603 for ; Tue, 7 Feb 2012 10:32:30 +0200 Received: from taulurastas.csc.fi (193.166.1.172) by kusti.csc.fi (192.168.120.3) with Microsoft SMTP Server (TLS) id 8.3.159.2; Tue, 7 Feb 2012 10:33:27 +0200 Message-ID: <4F30E19E.6070808@csc.fi> Date: Tue, 7 Feb 2012 10:32:30 +0200 From: Aleksi Kallio Organization: CSC User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.26) Gecko/20120130 Red Hat/3.1.18-1.el6_2 Thunderbird/3.1.18 MIME-Version: 1.0 To: "users@activemq.apache.org" Subject: Re: How to create temporary topic without blocking? References: <1328421360825-4358480.post@n4.nabble.com> <4F2F9486.90307@csc.fi> <1328540789.11999.3.camel@OfficePC> In-Reply-To: <1328540789.11999.3.camel@OfficePC> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=193.166.0.100; country=FI; latitude=64.0000; longitude=26.0000; http://maps.google.com/maps?q=64.0000,26.0000&z=6 X-CanItPRO-Stream: 00_Opt_Out (inherits from default) X-Scanned-By: CanIt (www . roaringpenguin . com) on 193.166.3.97 X-Virus-Checked: Checked by ClamAV on apache.org Thanks! So there is no way to have both long and short timeouts in one connection? I would like to keep the infinite failover, but then for certain API calls, have it fail immediately if connection is lost. On 2012-02-06 17:06, Timothy Bish wrote: > You need to use the Failover transport options to configure the > transport to fail after some amount of time, the timeout option will let > you do that, see: > > http://activemq.apache.org/failover-transport-reference.html > > > > On Mon, 2012-02-06 at 10:51 +0200, Aleksi Kallio wrote: >> Hi, >> >> We have client apps connecting to our server environment using ActiveMQ, >> with failover enabled. Our users can have the app open on a laptop while >> moving from one network to another or to a completely unconnected place. >> >> ActiveMQ does beautiful failover, keeping the system running between >> network connections. However there are certain cases when we would like >> to use our own "failover mechanism". >> >> To do that, we would need to be able to check connection state or have >> an exception thrown when connection is not active. Now when you try to >> send a message and create a temporary reply topic without network >> connection it hangs on session.createTemporaryTopic(). >> >> How to not block on session.createTemporaryTopic() when the network is >> disconnected? >> >> I tried setting useAsyncSend to true and checking >> connection.isTransportFailed() before calling createTemporaryTopic(), >> but neither of them helped. >> >> Creating a throwaway thread for the send attempt is a solution, but a >> very crude one. >> >> All the best, >> Aleksi >> >