On Tue, Nov 22, 2011 at 1:17 PM, baklarz <tdrobiszew...@gmail.com> wrote:
> I'm tried several configurations. Exceptions inside jms/activemq are
> completly ignored by camel arror handler.
>
> This line in log drives me crazy.
> 2011-11-22 12:59:11,700 WARN
> [org.apache.camel.component.jms.JmsMessageListenerContainer] - <Execution of
> JMS message listener failed, and no ErrorHandler has been set.>
>
> I found this
> http://mail-archives.apache.org/mod_mbox/activemq-users/201105.mbox/%3CBANLkTi=pdeudjzopqagg0hkcatazbq8...@mail.gmail.com%3E
>
>
> How to setup route,error handling to catch  exceptions "inside" activeqm
> propagation and resend it again to queue ?
> Is it possible inside camel context ?
>

You can configure an errorHandler on the JMS endpoint, there is an
errorHandler option.
Mind that this errorHandler is Spring / JMS specific.

And its just a callback if an exception occurred. And its not tied
back to the Camel routing engine.
There is a JIRA ticket to look into whether that is possible. The
problem is the async nature of JMS, and the API of the errorHandler.

If using AMQ you can enable sync sending, which means any error during
sending will be propagated back. And Camel can react upon it.






>     <camelContext xmlns="http://camel.apache.org/schema/spring";>
>        <onException>
>            <exception>org.apache.camel.RuntimeCamelException</exception>
>
> <exception>org.springframework.mail.MailSendException</exception>
>            <exception>javax.mail.MessagingException</exception>
>             <redeliveryPolicy maximumRedeliveries="1"
> redeliveryDelay="30000"/>
>               <camel:handled>
>                <camel:constant>true</camel:constant>
>                </camel:handled>
>             <to uri="activemq:queue:businessFailed"/>
>        </onException>
>
>        <route>
>            <from uri="activemq:queue:ThankYou.EndDonationSuccessEvent" />
>              <delay>
>                <constant>30000</constant>
>            </delay>
>            <bean ref="emailTranslator" method="prepareThankYouEmail" />
>
>            <to uri="activemq:queue:QUEUE.EMAIL_NOTIFICATIONS" />
>
>        </route>
>
>        </camelContext>
>
>
>        <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>
>                <property name="connectionFactory">
>                        <bean 
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                                <property name="brokerURL"
>
> value="failover:(tcp://mq-1:61616,tcp://mq-2:61616)?timeout=3000&amp;randomize=false"
> />
>                        </bean>
>                </property>
>        </bean>
>
> I'm using apache-camel 2.8.2
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/errorHandler-for-activemq-component-example-configuration-tp5013373p5013373.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to