Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-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 21A86DC05 for ; Fri, 17 May 2013 13:06:33 +0000 (UTC) Received: (qmail 13891 invoked by uid 500); 17 May 2013 12:55:45 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 13797 invoked by uid 500); 17 May 2013 12:55:42 -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 13618 invoked by uid 99); 17 May 2013 12:55:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 12:55:33 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.223.181 as permitted sender) Received: from [209.85.223.181] (HELO mail-ie0-f181.google.com) (209.85.223.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 12:55:30 +0000 Received: by mail-ie0-f181.google.com with SMTP id x12so8783087ief.26 for ; Fri, 17 May 2013 05:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=0TEsoYP3sjsB45FnBrPFk7/1qpfEb1xQCzajP1pA5nc=; b=RqlpYlQPPbuyZiqRy/e6pEnWxRNxVHUj8sXyu5wjGdpvi/pAbLWbDWs4m+km5hpmQA R4y9pSgQyOH3iXLQpFYcH4iiUvCVr5t4BcxRy9ISPNJJVLzGlPbn7v0kIJDJUK12NONS mN0Bn4S8x+9wnORlQepdldbK+xv1DUWwOoIZpLWs6ExGvjxIRKSXXJIt6C7uhxeAAKW6 NxoRJcqh/Uo1rC7n4p77UIYc11ponhgXP+g0aOoaETr4MEyEVkwchzv+gaOhfK2rbeQL 7FFR5NaKq5XBM6MCaTcMfr6BVpeo4cFeauvCXMqyHWv2xdt5/2kbu4pGJFw+JU1C3l/b 9Fcw== X-Received: by 10.50.45.230 with SMTP id q6mr12910202igm.39.1368795309704; Fri, 17 May 2013 05:55:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.20.200 with HTTP; Fri, 17 May 2013 05:54:49 -0700 (PDT) In-Reply-To: <1368770624886-5732703.post@n5.nabble.com> References: <1368770624886-5732703.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 17 May 2013 14:54:49 +0200 Message-ID: Subject: Re: Best way for ScheduledBatchPollingConsumer to signal failure To: "users@camel.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi You can use the bridge error handler option http://camel.apache.org/why-does-my-file-consumer-not-pick-up-the-file-and-how-do-i-let-the-file-consumer-use-the-camel-error-handler.html Then an empty exchange with the caused exception is routed, and your error handler can detect and handle it, as if the error occurred during routing. On Fri, May 17, 2013 at 8:03 AM, Preben.Asmussen wrote: > Hi > > I have worked on a consumer component that extends the > ScheduledBatchPollingConsumer, and want to signal when an error occurs > during connect to a remote resource (basic http). Atm any connect error will > be logged, but I want it to surface in jmx attribute like the > ExchangesFailed and LastExchangeFaliure..... attributes. This way monitoring > can pick up any failures and report it. > The problem is that to expose this as a jmx attribute it requires a > exchange, and since the error occurs while connecting to the remote > resource (to poll and create exchanges) it is not possible. > Is there any examples to handle such feature ? eg. catch the exception and > create a 'failed exchange' manually, or ?? > > /Preben > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Best-way-for-ScheduledBatchPollingConsumer-to-signal-failure-tp5732703.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- www.camelone.org: The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen