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.
 
 
 
 
 
 

186 lines
9.6 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. <import resource="classpath:spring/base-instance.xml" />
  13. <bean id="instance" class="com.alibaba.otter.canal.instance.spring.CanalInstanceWithSpring">
  14. <property name="destination" value="${canal.instance.destination}" />
  15. <property name="eventParser">
  16. <ref bean="eventParser" />
  17. </property>
  18. <property name="eventSink">
  19. <ref bean="eventSink" />
  20. </property>
  21. <property name="eventStore">
  22. <ref bean="eventStore" />
  23. </property>
  24. <property name="metaManager">
  25. <ref bean="metaManager" />
  26. </property>
  27. <property name="alarmHandler">
  28. <ref bean="alarmHandler" />
  29. </property>
  30. <property name="mqConfig">
  31. <ref bean="mqConfig" />
  32. </property>
  33. </bean>
  34. <!-- 报警处理类 -->
  35. <bean id="alarmHandler" class="com.alibaba.otter.canal.common.alarm.LogAlarmHandler" />
  36. <bean id="metaManager" class="com.alibaba.otter.canal.meta.MemoryMetaManager" />
  37. <bean id="eventStore" class="com.alibaba.otter.canal.store.memory.MemoryEventStoreWithBuffer">
  38. <property name="bufferSize" value="${canal.instance.memory.buffer.size:16384}" />
  39. <property name="bufferMemUnit" value="${canal.instance.memory.buffer.memunit:1024}" />
  40. <property name="batchMode" value="${canal.instance.memory.batch.mode:MEMSIZE}" />
  41. <property name="ddlIsolation" value="${canal.instance.get.ddl.isolation:false}" />
  42. <property name="raw" value="${canal.instance.memory.rawEntry:true}" />
  43. </bean>
  44. <bean id="eventSink" class="com.alibaba.otter.canal.sink.entry.EntryEventSink">
  45. <property name="eventStore" ref="eventStore" />
  46. <property name="filterTransactionEntry" value="${canal.instance.filter.transaction.entry:false}"/>
  47. </bean>
  48. <bean id="eventParser" parent="baseEventParser">
  49. <property name="destination" value="${canal.instance.destination}" />
  50. <property name="slaveId" value="${canal.instance.mysql.slaveId:0}" />
  51. <!-- 心跳配置 -->
  52. <property name="detectingEnable" value="${canal.instance.detecting.enable:false}" />
  53. <property name="detectingSQL" value="${canal.instance.detecting.sql}" />
  54. <property name="detectingIntervalInSeconds" value="${canal.instance.detecting.interval.time:5}" />
  55. <property name="haController">
  56. <bean class="com.alibaba.otter.canal.parse.ha.HeartBeatHAController">
  57. <property name="detectingRetryTimes" value="${canal.instance.detecting.retry.threshold:3}" />
  58. <property name="switchEnable" value="${canal.instance.detecting.heartbeatHaEnable:false}" />
  59. </bean>
  60. </property>
  61. <property name="alarmHandler" ref="alarmHandler" />
  62. <!-- 解析过滤处理 -->
  63. <property name="eventFilter">
  64. <bean class="com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter" >
  65. <constructor-arg index="0" value="${canal.instance.filter.regex:.*\..*}" />
  66. </bean>
  67. </property>
  68. <property name="eventBlackFilter">
  69. <bean class="com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter" >
  70. <constructor-arg index="0" value="${canal.instance.filter.black.regex:}" />
  71. <constructor-arg index="1" value="false" />
  72. </bean>
  73. </property>
  74. <property name="fieldFilter" value="${canal.instance.filter.field}" />
  75. <property name="fieldBlackFilter" value="${canal.instance.filter.black.field}" />
  76. <!-- 最大事务解析大小,超过该大小后事务将被切分为多个事务投递 -->
  77. <property name="transactionSize" value="${canal.instance.transaction.size:1024}" />
  78. <!-- 网络链接参数 -->
  79. <property name="receiveBufferSize" value="${canal.instance.network.receiveBufferSize:16384}" />
  80. <property name="sendBufferSize" value="${canal.instance.network.sendBufferSize:16384}" />
  81. <property name="defaultConnectionTimeoutInSeconds" value="${canal.instance.network.soTimeout:30}" />
  82. <!-- 解析编码 -->
  83. <!-- property name="connectionCharsetNumber" value="${canal.instance.connectionCharsetNumber:33}" /-->
  84. <property name="connectionCharset" value="${canal.instance.connectionCharset:UTF-8}" />
  85. <!-- 解析位点记录 -->
  86. <property name="logPositionManager">
  87. <bean class="com.alibaba.otter.canal.parse.index.MemoryLogPositionManager" />
  88. </property>
  89. <!-- failover切换时回退的时间 -->
  90. <property name="fallbackIntervalInSeconds" value="${canal.instance.fallbackIntervalInSeconds:60}" />
  91. <!-- 解析数据库信息 -->
  92. <property name="masterInfo">
  93. <bean class="com.alibaba.otter.canal.parse.support.AuthenticationInfo" init-method="initPwd">
  94. <property name="address" value="${canal.instance.master.address}" />
  95. <property name="username" value="${canal.instance.dbUsername:retl}" />
  96. <property name="password" value="${canal.instance.dbPassword:retl}" />
  97. <property name="pwdPublicKey" value="${canal.instance.pwdPublicKey:retl}" />
  98. <property name="enableDruid" value="${canal.instance.enableDruid:false}" />
  99. <property name="defaultDatabaseName" value="${canal.instance.defaultDatabaseName:}" />
  100. </bean>
  101. </property>
  102. <property name="standbyInfo">
  103. <bean class="com.alibaba.otter.canal.parse.support.AuthenticationInfo" init-method="initPwd">
  104. <property name="address" value="${canal.instance.standby.address}" />
  105. <property name="username" value="${canal.instance.dbUsername:retl}" />
  106. <property name="password" value="${canal.instance.dbPassword:retl}" />
  107. <property name="pwdPublicKey" value="${canal.instance.pwdPublicKey:retl}" />
  108. <property name="enableDruid" value="${canal.instance.enableDruid:false}" />
  109. <property name="defaultDatabaseName" value="${canal.instance.defaultDatabaseName:}" />
  110. </bean>
  111. </property>
  112. <!-- 解析起始位点 -->
  113. <property name="masterPosition">
  114. <bean class="com.alibaba.otter.canal.protocol.position.EntryPosition">
  115. <property name="journalName" value="${canal.instance.master.journal.name}" />
  116. <property name="position" value="${canal.instance.master.position}" />
  117. <property name="timestamp" value="${canal.instance.master.timestamp}" />
  118. <property name="gtid" value="${canal.instance.master.gtid}" />
  119. </bean>
  120. </property>
  121. <property name="standbyPosition">
  122. <bean class="com.alibaba.otter.canal.protocol.position.EntryPosition">
  123. <property name="journalName" value="${canal.instance.standby.journal.name}" />
  124. <property name="position" value="${canal.instance.standby.position}" />
  125. <property name="timestamp" value="${canal.instance.standby.timestamp}" />
  126. <property name="gtid" value="${canal.instance.standby.gtid}" />
  127. </bean>
  128. </property>
  129. <property name="filterQueryDml" value="${canal.instance.filter.query.dml:false}" />
  130. <property name="filterQueryDcl" value="${canal.instance.filter.query.dcl:false}" />
  131. <property name="filterQueryDdl" value="${canal.instance.filter.query.ddl:false}" />
  132. <property name="useDruidDdlFilter" value="${canal.instance.filter.druid.ddl:true}" />
  133. <property name="filterDmlInsert" value="${canal.instance.filter.dml.insert:false}" />
  134. <property name="filterDmlUpdate" value="${canal.instance.filter.dml.update:false}" />
  135. <property name="filterDmlDelete" value="${canal.instance.filter.dml.delete:false}" />
  136. <property name="filterRows" value="${canal.instance.filter.rows:false}" />
  137. <property name="filterTableError" value="${canal.instance.filter.table.error:false}" />
  138. <property name="supportBinlogFormats" value="${canal.instance.binlog.format}" />
  139. <property name="supportBinlogImages" value="${canal.instance.binlog.image}" />
  140. <!--表结构相关-->
  141. <property name="enableTsdb" value="${canal.instance.tsdb.enable:false}"/>
  142. <property name="tsdbSpringXml" value="${canal.instance.tsdb.spring.xml:}"/>
  143. <property name="tsdbSnapshotInterval" value="${canal.instance.tsdb.snapshot.interval:24}" />
  144. <property name="tsdbSnapshotExpire" value="${canal.instance.tsdb.snapshot.expire:360}" />
  145. <!--是否启用GTID模式-->
  146. <property name="isGTIDMode" value="${canal.instance.gtidon:false}"/>
  147. <!-- parallel parser -->
  148. <property name="parallel" value="${canal.instance.parser.parallel:true}" />
  149. <property name="parallelThreadSize" value="${canal.instance.parser.parallelThreadSize}" />
  150. <property name="parallelBufferSize" value="${canal.instance.parser.parallelBufferSize:256}" />
  151. <property name="autoResetLatestPosMode" value="${canal.auto.reset.latest.pos.mode:false}" />
  152. </bean>
  153. <bean id="mqConfig" class="com.alibaba.otter.canal.instance.core.CanalMQConfig">
  154. <property name="topic" value="${canal.mq.topic}" />
  155. <property name="dynamicTopic" value="${canal.mq.dynamicTopic}" />
  156. <property name="partition" value="${canal.mq.partition}" />
  157. <property name="partitionsNum" value="${canal.mq.partitionsNum}" />
  158. <property name="partitionHash" value="${canal.mq.partitionHash}" />
  159. <property name="dynamicTopicPartitionNum" value="${canal.mq.dynamicTopicPartitionNum}" />
  160. <property name="enableDynamicQueuePartition" value="${canal.mq.enableDynamicQueuePartition}" />
  161. </bean>
  162. </beans>