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.
 
 
 
 
 
 

62 lines
3.3 KiB

  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="org.h2.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="testWhileIdle" value="true" />
  40. <property name="testOnBorrow" value="false" />
  41. <property name="testOnReturn" value="false" />
  42. <property name="useUnfairLock" value="true" />
  43. <property name="validationQuery" value="SELECT 1" />
  44. </bean>
  45. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  46. <property name="dataSource" ref="dataSource"/>
  47. <property name="configLocation" value="classpath:spring/tsdb/sql-map/sqlmap-config.xml"/>
  48. </bean>
  49. <bean id="metaHistoryDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaHistoryDAO">
  50. <property name="sqlSessionFactory" ref="sqlSessionFactory"/>
  51. </bean>
  52. <bean id="metaSnapshotDAO" class="com.alibaba.otter.canal.parse.inbound.mysql.tsdb.dao.MetaSnapshotDAO">
  53. <property name="sqlSessionFactory" ref="sqlSessionFactory"/>
  54. </bean>
  55. </beans>