Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 93834 invoked from network); 23 Mar 2010 21:33:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Mar 2010 21:33:56 -0000 Received: (qmail 22061 invoked by uid 500); 23 Mar 2010 21:33:56 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 22014 invoked by uid 500); 23 Mar 2010 21:33:56 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 22006 invoked by uid 99); 23 Mar 2010 21:33:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 21:33:56 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of allen.lau@gmail.com designates 209.85.222.179 as permitted sender) Received: from [209.85.222.179] (HELO mail-pz0-f179.google.com) (209.85.222.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 21:33:49 +0000 Received: by pzk9 with SMTP id 9so644754pzk.21 for ; Tue, 23 Mar 2010 14:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=47eWU1mmJ6yeSYWMTKgYNT69NqlEHy0D+aGfAMSiCeA=; b=nkz71V7ODjIS3scuE6AgfqKpSUQnWoaSpvDJhdK9FoP1XRvNnnGvz1StAelCpNigAA FHdhl/fEwY1AxI7dctMjG/JkKzs21Db1fQjb5/i9XtgAKDcdhuX5GyR/yoQBl/iYMsPB unSRBVnYuuOFkqK1KEXCmBKFhtEyFpfLQgktg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BCEog60Mrp4ensgfdYevcIMZQL+mjGzpESH7lU0yeZ0wnUWebtIfYV9WTV7+bPlmDA My5JFFuCl/jZfayzOYPdLi7dFQIOTbbo5VF2iFGK1G0BAAhJb/ojPLHR3H70wgNgsheI N+dfftm1vCwYSK/0dWbqegWS+8WuKJ3AMCuIY= MIME-Version: 1.0 Received: by 10.141.45.2 with HTTP; Tue, 23 Mar 2010 14:25:52 -0700 (PDT) In-Reply-To: <28005566.post@talk.nabble.com> References: <28005566.post@talk.nabble.com> Date: Tue, 23 Mar 2010 14:25:52 -0700 Received: by 10.141.188.24 with SMTP id q24mr14058rvp.0.1269379552439; Tue, 23 Mar 2010 14:25:52 -0700 (PDT) Message-ID: <62c54aad1003231425o3b3458e7r72f7af8f8e028e3f@mail.gmail.com> Subject: Re: error-handling advice with queues From: Allen Lau To: users@camel.apache.org Content-Type: multipart/alternative; boundary=000e0cd17ed44eee6304827e7509 --000e0cd17ed44eee6304827e7509 Content-Type: text/plain; charset=UTF-8 How about just setting a header when you are done processing and there is an error? Then in your route, just send any message to the error queue when the header is detected. On Tue, Mar 23, 2010 at 11:57 AM, jfaath wrote: > > I'm looking for some advice on how to deal with errors during a large > processing task. It seems like it should be simple but I'm having trouble > figuring out what to do. > > I have an HTTP endpoint that receives XML messages then sticks them in a > processing queue. From the queue, they get unmarshalled into JAXB objects > and then processed by a Java class. Now, the messages consist or a large > number of readings. Some may be good, some may be bad. The good ones get > processed, but the bad ones are stuffed into a JAXB object. > > When the processing is done, I'd like to throw this object on an error > queue > (or, marshal then throw on the queue). But I can't figure out how to do > this the best way. The processing class should exit gracefully so I don't > want to throw a final exception. > > What might be the best way to do this? Can I add the error object to a > queue programmatically within the processor? Can the processor return the > error object so I can throw it on the queue via the route? Is there a nice > and easy way to do this? > > Thanks, > > JF > -- > View this message in context: > http://old.nabble.com/error-handling-advice-with-queues-tp28005566p28005566.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --000e0cd17ed44eee6304827e7509--