Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 47795 invoked from network); 11 Dec 2008 06:44:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2008 06:44:15 -0000 Received: (qmail 70298 invoked by uid 500); 11 Dec 2008 06:44:27 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 70281 invoked by uid 500); 11 Dec 2008 06:44:26 -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 70270 invoked by uid 99); 11 Dec 2008 06:44:26 -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:44:26 -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:44:04 +0000 Received: by qyk5 with SMTP id 5so1196363qyk.14 for ; Wed, 10 Dec 2008 22:43:44 -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=ONGhaMdp+/NleEqzBaj1RL/C+Ssd14s/w1sby7sxjUo=; b=hW3kZ2bFj3GP6VgAcMJyG/0CQmP0BwmgsHo6Tnmy43ODvAmgHokJmCqJRqPfm1TmBE SaQQfr25VzXMdMod9a4GFVdPybhqthkJNOWaC3/6vYCN8lIa3QdQde697JaaJPnq37jk O2hfsCGRGVuZhHqNc5ava2txhb4HZMDOn/Bro= 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=aUoophbG5jUAULLX2WaqRqpO4STR/FBv4DPeYDwtRG2Yvat1IG9a+++ydrhSSa5Yw2 Cxca/yQXOGdghDqRH29SUMmSeGNBXU5Jl1TmOe0xSK4eSq1lSyJqGC7SaaAWaL6zsle0 uWdCjByn+G6eUTFY1kIEMdUNLG0zjDgxkBq8Q= Received: by 10.214.217.8 with SMTP id p8mr3211636qag.20.1228977823961; Wed, 10 Dec 2008 22:43:43 -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 6sm5027747qwk.52.2008.12.10.22.43.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Dec 2008 22:43:43 -0800 (PST) Message-Id: <54952AF8-1DA0-4019-AD54-24964F103316@gmail.com> From: Rob Davies To: users@activemq.apache.org In-Reply-To: <20950155.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:43:40 +0000 References: <20947923.post@talk.nabble.com> <20949967.post@talk.nabble.com> <20950155.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 06:34, PankajGugnani wrote: > > Hi rajdavies, > > Thanks for the quick reply. > In my project, I want to throw an exception if timeout occured. But > for > this, I need to know what happened to the message. Is it published > or is it > discarded. And also, is there way by which I can get an > acknowledgement of > what happend to the message(like added to the queue or discarded) > You might be better off using advisories to achieve what you need. The publishing is decoupled from the dispatch of the message - see: http://activemq.apache.org/advisory-message.html for 5.2. There needs to be some better documentation around that - so you can grok how to configure them - will try remember to do that when I'm not on vacation (and the wife has just woken up - so I'm in trouble working on my day off :)) > rajdavies wrote: >> >> >> On 11 Dec 2008, at 06:08, PankajGugnani wrote: >> >>> >>> Hi, >>> >>> can u please explain the behaviou in this particular case after the >>> TimeOut. >>> will there be an exception thrown if the timeout occurs. >>> >>> Thanks in advance >>> >>> rajdavies wrote: >> >> Not currently - I'm afraid there's no difference between a successful >> send and a request that timed out - perhaps someone should raise a >> jira for that one ? >>> >>>> >>>> >>>> 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/ >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/how-to-best-implement-a-producer-timeout-tp20947923p20949967.html >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/how-to-best-implement-a-producer-timeout-tp20947923p20950155.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >