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 290AB10D90 for ; Mon, 3 Mar 2014 05:14:37 +0000 (UTC) Received: (qmail 75287 invoked by uid 500); 3 Mar 2014 05:14:36 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 74655 invoked by uid 500); 3 Mar 2014 05:14:31 -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 74646 invoked by uid 99); 3 Mar 2014 05:14:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 05:14:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of noel.oconnor@gmail.com designates 209.85.192.46 as permitted sender) Received: from [209.85.192.46] (HELO mail-qg0-f46.google.com) (209.85.192.46) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 05:14:22 +0000 Received: by mail-qg0-f46.google.com with SMTP id e89so10085354qgf.5 for ; Sun, 02 Mar 2014 21:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=onzR6nuioZKJQAr42sPUnqBBD9QbxC/gxk2Ebz2GrdI=; b=yT+2cYRp+vtJ1m6AsihIR5iWyuRuVtuXe6KCsy1oDdmOQwxUcbST81y9wxGRfWdIKE aZrYA/eJtIvG3kr4dvsTUGs+XCfAb1II/klKhrPpr/9p3j+K2K9LHwNhmYtHnYySaD5B nhwsPIc4SRF1kVDks7XuaOQmoYNcsE/X0Q/2qV/5YAna/qehxqAfnfnb07497HQCefhM JyKPm9KD9FjHIvWT3/2QtADNe7zeH6KG1SiHNnXxC937P3ulNnLdeoDxhcqUbrga2kAW +x0XaAfduI/hyfrDQIgXaljyi93vwFYkpQKuz2gKMbJa5zMY9SKOhXu3If01151P6KSr A+aQ== X-Received: by 10.140.91.12 with SMTP id y12mr19770776qgd.26.1393823640943; Sun, 02 Mar 2014 21:14:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.185.66 with HTTP; Sun, 2 Mar 2014 21:13:40 -0800 (PST) In-Reply-To: References: From: Noel OConnor Date: Mon, 3 Mar 2014 16:13:40 +1100 Message-ID: Subject: Re: can a client "refuse" a message? To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001a113968acff82be04f3acdadd X-Virus-Checked: Checked by ClamAV on apache.org --001a113968acff82be04f3acdadd Content-Type: text/plain; charset=ISO-8859-1 If the mdb is in a transaction you could try rolling it back. If not (I think) the message should be redelivered if you throw a runtime exception from within the MDB. On Mon, Mar 3, 2014 at 3:35 PM, Li Li wrote: > hi all, > can a queue message consumer "refuse" a message after receive a > message? > because a client don't know the message in advance. > onMessage(Message msg){ > if(CannotProcess(msg)){ > //refuse this message > } > } > what I need is: if the message can't be processed by one client, it > can be sent to another consumer. > if all consumer "refuse" this message, then this message will be > removed to dead letter queue or to the end of the queue. > --001a113968acff82be04f3acdadd--