| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <beans xmlns="http://www.springframework.org/schema/beans" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:camel="http://camel.apache.org/schema/spring" |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
| http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd |
| "> |
| |
| <!-- START SNIPPET: example --> |
| <errorHandler id="loggingErrorHandler" type="LoggingErrorHandler" logName="foo" level="INFO" xmlns="http://camel.apache.org/schema/spring"/> |
| |
| <!-- If don't specify type attribute, the type value will be set to DefaultErrorHandler --> |
| <errorHandler id="errorHandler" xmlns="http://camel.apache.org/schema/spring"/> |
| |
| <!-- You can define the redeliveryPolicy inside of the errorHandler --> |
| <camel:errorHandler id="defaultErrorHandler" type="DefaultErrorHandler"> |
| <camel:redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="0" logStackTrace="false"/> |
| </camel:errorHandler> |
| |
| <camel:errorHandler id="deadLetterErrorHandler" type="DeadLetterChannel" deadLetterUri="log:dead"> |
| <camel:redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="1000" logHandled="true" asyncDelayedRedelivery="true"/> |
| </camel:errorHandler> |
| |
| <bean id="myErrorProcessor" class="org.apache.camel.spring.handler.MyErrorProcessor"/> |
| |
| <!-- TX error handler can be configured using a template --> |
| <camel:errorHandler id="transactionErrorHandler" type="TransactionErrorHandler" |
| transactionTemplateRef="PROPAGATION_REQUIRED" onRedeliveryRef="myErrorProcessor"/> |
| |
| <!-- or using a transaction manager --> |
| <camel:errorHandler id="txEH" type="TransactionErrorHandler" transactionManagerRef="txManager"/> |
| |
| <!-- You can also define the errorHandler inside the camelContext --> |
| <camelContext errorHandlerRef="noErrorHandler" xmlns="http://camel.apache.org/schema/spring"> |
| <errorHandler id="noErrorHandler" type="NoErrorHandler"/> |
| </camelContext> |
| <!-- END SNIPPET: example --> |
| |
| <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> |
| <property name="driverClassName" value="org.hsqldb.jdbcDriver"/> |
| <property name="url" value="jdbc:hsqldb:mem:camel"/> |
| <property name="username" value="sa"/> |
| <property name="password" value=""/> |
| </bean> |
| |
| <!-- spring transaction manager --> |
| <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| <property name="dataSource" ref="dataSource"/> |
| </bean> |
| |
| <bean id="PROPAGATION_REQUIRED" class="org.springframework.transaction.support.TransactionTemplate"> |
| <property name="transactionManager" ref="txManager"/> |
| </bean> |
| |
| </beans> |