Hi Michael,

If you use a Camel Interceptor to handle the exceptions throws, you will be
able to manage your use case (http://camel.apache.org/exception-clause.html
).

Regards,


On Wed, Sep 17, 2014 at 10:59 PM, MichaelAtSAG <mebevilac...@gmail.com>
wrote:

> Hi all,
>
> We have a SIMPLE transform step in a route that reports an exception
> infrequently. I suspect the exception arises when a data element is
> missing,
> which could be the case infrequently. When missing, I want the transform to
> just use empty space and not report exception.
>
> Here is the transform:
>
>                 <transform>
>                     <simple>JMS Channel processing tweet event from
> @${header.Status$User$ScreenName} at ${header.$Event$Start}</simple>
>                 </transform>
>
> Here is the exception:
> [Camel (STEP3_EDATweetReceivedFromJMS) thread #10 -
> JmsConsumer[Event::WebM::Communication::Twitter::1.1::TweetReceived]]
> EndpointMessageListener                  WARN  Execution of JMS message
> listener failed. Caused by: [org.apache.camel.RuntimeCamelException -
> java.lang.ArrayIndexOutOfBoundsException]
> org.apache.camel.RuntimeCamelException:
> java.lang.ArrayIndexOutOfBoundsException
>         at
>
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)
>         at
>
> org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:186)
>         at
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:107)
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1096)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1088)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:985)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.ArrayIndexOutOfBoundsException
>
>
> How do I write this so that no exceptions are thrown when the data element
> is missing?
>
> Thanks!
> Michael
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Error-with-transform-tp5756657.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to