2.0重构版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mysql-tsdb.xml 3.6 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:lang="http://www.springframework.org/schema/lang"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  7. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
  8. http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd
  9. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
  10. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"
  11. default-autowire="byName">
  12. <!-- properties -->
  13. <bean class="com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer" lazy-init="false">
  14. <property name="ignoreResourceNotFound" value="true" />
  15. <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/><!-- 允许system覆盖 -->
  16. <property name="locationNames">
  17. <list>
  18. <value>classpath:canal.properties</value>
  19. <value>classpath:${canal.instance.destination:}/instance.properties</value>
  20. </list>
  21. </property>
  22. </bean>
  23. <!-- 基于db的实现 -->
  24. <bean id="tableMetaTSDB" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta" destroy-method="destory">
  25. <property name="metaHistoryDAO" ref="metaHistoryDAO"/>
  26. <property name="metaSnapshotDAO" ref="metaSnapshotDAO"/>
  27. </bean>
  28. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
  29. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  30. <property name="url" value="${canal.instance.tsdb.url:}" />
  31. <property name="username" value="${canal.instance.tsdb.dbUsername:}" />
  32. <property name="password" value="${canal.instance.tsdb.dbPassword:}" />
  33. <property name="maxActive" value="30" />
  34. <property name="initialSize" value="0" />
  35. <property name="minIdle" value="1" />
  36. <property name="maxWait" value="10000" />
  37. <property name="timeBetweenEvictionRunsMillis" value="60000" />
  38. <property name="minEvictableIdleTimeMillis" value="300000" />
  39. <property name="validationQuery" value="SELECT 1" />
  40. <property name="exceptionSorterClassName" value="com.alibaba.druid.pool.vendor.MySqlExceptionSorter" />
  41. <property name="validConnectionCheckerClassName" value="com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker" />
  42. <property name="testWhileIdle" value="true" />
  43. <property name="testOnBorrow" value="false" />
  44. <property name="testOnReturn" value="false" />
  45. <property name="useUnfairLock" value="true" />
  46. </bean>
  47. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  48. <property name="dataSource" ref="dataSource"/>
  49. <property name="configLocation" value="classpath:spring/tsdb/sql-map/sqlmap-config.xml"/>
  50. </bean>
  51. <bean id="metaHistoryDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaHistoryDAO">
  52. <property name="sqlSessionFactory" ref="sqlSessionFactory"/>
  53. </bean>
  54. <bean id="metaSnapshotDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaSnapshotDAO">
  55. <property name="sqlSessionFactory" ref="sqlSessionFactory"/>
  56. </bean>
  57. </beans>