mysql-tsdb.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  5. http://www.springframework.org/schema/tx
  6. http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
  7. default-autowire="byName">
  8. <!-- 基于db的实现 -->
  9. <bean id="tableMetaTSDB" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta">
  10. <property name="metaHistoryDAO" ref="metaHistoryDAO"/>
  11. <property name="metaSnapshotDAO" ref="metaSnapshotDAO"/>
  12. </bean>
  13. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
  14. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  15. <property name="url" value="jdbc:mysql://127.0.0.1:3306/canal_tsdb" />
  16. <property name="username" value="canal" />
  17. <property name="password" value="canal" />
  18. <property name="maxActive" value="30" />
  19. <property name="initialSize" value="0" />
  20. <property name="minIdle" value="1" />
  21. <property name="maxWait" value="10000" />
  22. <property name="timeBetweenEvictionRunsMillis" value="60000" />
  23. <property name="minEvictableIdleTimeMillis" value="300000" />
  24. <property name="validationQuery" value="SELECT 1" />
  25. <property name="exceptionSorterClassName" value="com.alibaba.druid.pool.vendor.MySqlExceptionSorter" />
  26. <property name="validConnectionCheckerClassName" value="com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker" />
  27. <property name="testWhileIdle" value="true" />
  28. <property name="testOnBorrow" value="false" />
  29. <property name="testOnReturn" value="false" />
  30. <property name="useUnfairLock" value="true" />
  31. </bean>
  32. <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  33. <property name="dataSource" ref="dataSource"/>
  34. <property name="configLocation" value="classpath:tsdb/sql-map/sqlmap-config.xml"/>
  35. </bean>
  36. <bean id="metaHistoryDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaHistoryDAO">
  37. <property name="sqlMapClient" ref="sqlMapClient"/>
  38. </bean>
  39. <bean id="metaSnapshotDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaSnapshotDAO">
  40. <property name="sqlMapClient" ref="sqlMapClient"/>
  41. </bean>
  42. </beans>