Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 76864 invoked from network); 3 Aug 2009 05:18:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Aug 2009 05:18:15 -0000 Received: (qmail 13445 invoked by uid 500); 3 Aug 2009 05:18:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 13371 invoked by uid 500); 3 Aug 2009 05:18:20 -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 13361 invoked by uid 99); 3 Aug 2009 05:18:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 05:18:20 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 05:18:09 +0000 Received: by fxm12 with SMTP id 12so1653859fxm.20 for ; Sun, 02 Aug 2009 22:17:48 -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 :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Mc3gm8SdSpmDkpSgFnAJrhzMa1NJrdE9r2MjN7k+dLk=; b=E6nMri5IrOwwdXVh91g8tKnisHkcpfgoi9JnuS0+cReMsZ5odLzciA1N8Q1n/V+lyM l/n0/HBIndVjbFcd2yEuuTLzA4yEAjiXKQWs2/YLYp61rlLN4RwBVSykYJo4TgBBDx0I /ctwIuipYVl3xQtZKxerkS46TFG+QA6kEOKPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=GOocSONHzAXozOAKmIhVD5P1cMhFRtzi4Z1lymdHwdUBsIXtVjGKXK+kYPCDtfxnO4 6uEU6E+m1Ns6ftSWwShZPboFc0R9HrwgpavNIi6LOxsiKy12st8MMtYdewPvjLk2HbKP Yq8DOG4cexDqiSIt/wi/lnaAegBhEd6SeCGxI= MIME-Version: 1.0 Received: by 10.204.54.4 with SMTP id o4mr7458801bkg.208.1249276668084; Sun, 02 Aug 2009 22:17:48 -0700 (PDT) In-Reply-To: <4A76487F.7050400@gmail.com> References: <24761350.post@talk.nabble.com> <4A76487F.7050400@gmail.com> From: Claus Ibsen Date: Mon, 3 Aug 2009 07:17:28 +0200 Message-ID: <5380c69c0908022217n3ca891acyf05b78f61504fb21@mail.gmail.com> Subject: Re: Dropped jms messages on java.io.UTFDataFormatException To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Aug 3, 2009 at 4:16 AM, Willem Jiang wrote: > Hi, > > Current Camel Error handler only works for the checking the error which i= s > thrown between the route's endpoints. > > Your UTFDataFormatException is thrown when the Message is created to be > routed into the pipeline, I don't think the camel error handler can catch > this kind of error. > Yes the Camel error handling is based on message exchanges and not on initial transport issues. You can / should remedy this with AMQ as its has a poison message. And must have means to be able to deal with it in AMQ. > Maybe we need to do some enhancement on the JMSComponent to let it create= a > message with exception when it create the camel message from the JMS > message, then camel error handle will check it when this message =A0is ro= uting > to the other endpoint. > Yeah its kinda a trade off whether Camel should be able to create an artificial message and set the caused exception on it to allow Camel to handle the exception. But what if the exception was some remote connection exception and not as in this case some JMS payload issues. Its kinda hard to do this well and generic for all components. > Willem > > Ensonik wrote: >> >> Hi all, >> >> We currently have a problem where messages that can't be read properly g= et >> dropped instead of being put into a dlq. I have an errorHandler that wor= ks >> properly when the exception is thrown from within the route (from a >> processor for example), but refuses to kick in when it's a lower level >> error >> (i.e.: Before even getting into the route). >> >> - I'm using camel-2.0-M1 >> - The route is setup through the Java dsl >> >> The route looks something like: >> =A0 =A0 =A0 =A0errorHandler( >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0deadLetterChannel(configuration.getDLQCom= pomentUrl()). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0maximumRedeliveries(configuration.getMaxR= edeliveries()). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0log(RTSListenerRouteBuilder.class). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0retriesExhaustedLogLevel(LoggingLevel.ERR= OR). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0retryAttemptedLogLevel(LoggingLevel.TRACE= ) >> =A0 =A0 =A0 =A0); >> >> =A0 =A0 =A0 =A0from(configuration.getSourceComponentUrl()). >> =A0 =A0 =A0 =A0choice(). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0when(configuration.getMessageFilter()). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0process(configuration.get= MessageEnricher()). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0to(configuration.getMessa= geEndpoint()). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0otherwise(). >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0to(configuration.getInval= idMessageComponentUrl()); >> >> Pretty straightforward ... I've tried adding a few variants, most notabl= e >> adding a global exception handler: >> >> >> onException(java.io.UTFDataFormatException.class).handled(false).to("jms= .mydlq"); >> >> To no avail. >> >> Here's the stack trace I get: >> [WARN] [org.springframework.jms.listener.DefaultMessageListenerContainer= ] >> Execution of JMS message listener failed >> org.apache.camel.RuntimeCamelException: Failed to extract body due to: >> javax.jms.JMSException: java.io.UTFDataFormatException. Message: >> ActiveMQTextMessage {...l} >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.= java:104) >> =A0 =A0 =A0 =A0at >> org.apache.camel.component.jms.JmsMessage.createBody(JmsMessage.java:150= ) >> =A0 =A0 =A0 =A0at >> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:45) >> =A0 =A0 =A0 =A0at >> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(= StreamCachingInterceptor.java:74) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcess= or.java:52) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.= java:41) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP= rocessor.java:65) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpoin= tMessageListener.java:72) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvo= keListener(AbstractMessageListenerContainer.java:543) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.AbstractMessageListenerContainer.invoke= Listener(AbstractMessageListenerContainer.java:482) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.AbstractMessageListenerContainer.doExec= uteListener(AbstractMessageListenerContainer.java:451) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.AbstractPollingMessageListenerContainer= .doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.AbstractPollingMessageListenerContainer= .receiveAndExecute(AbstractPollingMessageListenerContainer.java:261) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe= ssageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:98= 2) >> =A0 =A0 =A0 =A0at >> >> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe= ssageListenerInvoker.run(DefaultMessageListenerContainer.java:881) >> =A0 =A0 =A0 =A0at java.lang.Thread.run(Thread.java:613) >> Caused by: javax.jms.JMSException: java.io.UTFDataFormatException >> =A0 =A0 =A0 =A0at >> >> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.= java:62) >> =A0 =A0 =A0 =A0at >> >> org.apache.activemq.command.ActiveMQTextMessage.getText(ActiveMQTextMess= age.java:91) >> =A0 =A0 =A0 =A0at >> >> org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.= java:93) >> =A0 =A0 =A0 =A0... 16 more >> Caused by: java.io.UTFDataFormatException >> =A0 =A0 =A0 =A0at >> >> org.apache.activemq.util.MarshallingSupport.readUTF8(MarshallingSupport.= java:372) >> =A0 =A0 =A0 =A0at >> >> org.apache.activemq.command.ActiveMQTextMessage.getText(ActiveMQTextMess= age.java:86) >> =A0 =A0 =A0 =A0... 17 more >> >> >> >> Thanks for any input. >> > > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus