Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 25702 invoked from network); 11 Dec 2008 06:05:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2008 06:05:57 -0000 Received: (qmail 30923 invoked by uid 500); 11 Dec 2008 06:06:09 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 30903 invoked by uid 500); 11 Dec 2008 06:06:09 -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 30892 invoked by uid 99); 11 Dec 2008 06:06:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2008 22:06:09 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajdavies@gmail.com designates 209.85.221.12 as permitted sender) Received: from [209.85.221.12] (HELO mail-qy0-f12.google.com) (209.85.221.12) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 06:05:47 +0000 Received: by qyk5 with SMTP id 5so1188150qyk.14 for ; Wed, 10 Dec 2008 22:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=kzyHSwCGFcXZcvedmZpZLm0Eq2/ElSCqDVPbx5vz/JY=; b=IiPiG96b2CQ7iwnpFC9z4Y49D3cTfo57pt0d6NIGJRNbmYhyxOvmJ94GItJ/PFgwmK H/I9T7SXGJrqxgrEULe7UuVYELkx/psWAADcIn8C93eIl3NW82UBbclB8Dscbn7gCz7c HK+SD3CT2hG/I7+nw1BEJX//qEG+of44aUG9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=USZOxPz5tJLCsuibWRcxcATrkUlsK+rlUC0hVVwHrARAWGTOWD9QB8H/gpLQA65LAX mFZlC4zV5AulnCtCQqD68HZrDHRsul6rDlhiBc7o503Ltx4wu9ztRtXSHUrENK/QBlUX 6gMUZt0T76LDeTxBaGgI4UZ9MuPfb0k3tKftI= Received: by 10.214.241.1 with SMTP id o1mr3166322qah.201.1228975525780; Wed, 10 Dec 2008 22:05:25 -0800 (PST) Received: from ?192.168.1.142? (host86-142-157-167.range86-142.btcentralplus.com [86.142.157.167]) by mx.google.com with ESMTPS id 8sm3403767qwj.43.2008.12.10.22.05.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Dec 2008 22:05:24 -0800 (PST) Message-Id: From: Rob Davies To: users@activemq.apache.org In-Reply-To: <20947923.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: how to best implement a producer timeout Date: Thu, 11 Dec 2008 06:05:21 +0000 References: <20947923.post@talk.nabble.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On 11 Dec 2008, at 01:38, emc2family wrote: > > Hi, > > when a broker starts to block producers as a result of producer flow > control, is there an elegant way for a producer to timeout as a > result of > this? i was thinking of setting the message's timetolive to achieve > this. > i suppose i could also use maxinactivityduration. i think both will > throw a > jmsexception. which leads me to my next question. is there a > specific > error code for a timetolive or maxinactivityduration exceptions? > thanks a > bunch. > -- > View this message in context: http://www.nabble.com/how-to-best-implement-a-producer-timeout-tp20947923p20947923.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > Not elegant - but one of these - if you are sending with default delivery mode (PERSISTENT): When you create your MessageProducer - cast it to an org.apache.activemq.ActiveMQMessageProducer and set it via the setSendTimeout(int ) method or set the sendTimeout property on the ActiveMQConnection or set the sendTimeout on the ActiveMQConnectionFactory - either directly or via a property or my favourite: Set the sendTimeout as a property on the destination used to create the producer - e.g. if you want to send on a Topic called "foo" - call Destination dest= session.createTopic("foo?producer.sendTimeout="5000"); MessageProducer producer = session.createProducer(dest); cheers, Rob Rob Davies http://fusesource.com http://rajdavies.blogspot.com/