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 D783979D3 for ; Wed, 17 Aug 2011 17:54:31 +0000 (UTC) Received: (qmail 45256 invoked by uid 500); 17 Aug 2011 17:54:31 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 45172 invoked by uid 500); 17 Aug 2011 17:54:30 -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 45164 invoked by uid 99); 17 Aug 2011 17:54:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 17:54:30 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of walter.p.closenfleight@gmail.com designates 74.125.83.43 as permitted sender) Received: from [74.125.83.43] (HELO mail-gw0-f43.google.com) (74.125.83.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 17:54:22 +0000 Received: by gwm11 with SMTP id 11so481278gwm.2 for ; Wed, 17 Aug 2011 10:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ap9M+MdNKLB9hOXAFPqyiRrVbyVhN+kVWcHhh2DuvHk=; b=LH40j9j7z1QvCu30jqkkU6OyqIK0YY8kpJsi9XOMZXawsoGpnroHS5G2++q1m8+C7D BXLgKgmz0dd9DzC42Ky0dFoB7pOnVPgcNCW76mvERtGIBN3uuK8COJGAgk5Xq0FaMClx ZsXw8PVVWHc89HFzPP6xk7bGdUZynGTEnK5C4= MIME-Version: 1.0 Received: by 10.151.25.12 with SMTP id c12mr1456239ybj.116.1313603641718; Wed, 17 Aug 2011 10:54:01 -0700 (PDT) Received: by 10.147.35.10 with HTTP; Wed, 17 Aug 2011 10:54:01 -0700 (PDT) Date: Wed, 17 Aug 2011 12:54:01 -0500 Message-ID: Subject: How to deal with failures on a queue From: Walter Closenfleight To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=000e0cd293c270b96c04aab72e09 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd293c270b96c04aab72e09 Content-Type: text/plain; charset=ISO-8859-1 I'm confused on how to deal with failures. If any part of my logic in the processMsg (below) fails (external resources not available, wrong parameters passed in queueMsg, etc.) then I do not want the message to be dequeued. I realize, however, that the message will then just fire again and keep failing. So, how do I deal with failures? If the message in the queueMsg is important and I don't want to lose its data, how can I prevent that from happening? Perhaps I could bundle the queueMsg into a failures area on my machine and analyze them programmatically or by hand at a later time. @Async *public* *void* processMsg(QueueMessage queueMsg) { // check if database available, if not, put this message back on queue or store somewhere } Cheers! --000e0cd293c270b96c04aab72e09--