<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
       default-autowire="byName">
	
	<!-- 基于db的实现 -->
	<bean id="tableMetaTSDB" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta">
		<property name="metaHistoryDAO" ref="metaHistoryDAO"/>
		<property name="metaSnapshotDAO" ref="metaSnapshotDAO"/>
	</bean>
	
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
        <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
        <property name="url" value="jdbc:derby:derbyTest;create=true" />
		<property name="username" value="canal" />
		<property name="password" value="canal" />
        <property name="maxActive" value="30" />
        <property name="initialSize" value="0" />
        <property name="minIdle" value="1" />
        <property name="maxWait" value="10000" />
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="300000" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
        <property name="useUnfairLock" value="true" />
	</bean>

    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="configLocation" value="classpath:tsdb/sql-map/sqlmap-config.xml"/>
    </bean>

    <bean id="metaHistoryDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaHistoryDAO">
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>

    <bean id="metaSnapshotDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaSnapshotDAO">
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>
</beans>
