Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 canal.instance.filter.regex 设置的问题 #922

Closed
shizhengchao opened this issue Sep 7, 2018 · 5 comments
Closed

关于 canal.instance.filter.regex 设置的问题 #922

shizhengchao opened this issue Sep 7, 2018 · 5 comments

Comments

@shizhengchao
Copy link

版本 1.0.24
@agapple
问题现象:
在同一个mysql中
我的canal.instance.filter.regex=cms\.rc_.*,意思是只订阅cms数据库下的rc_开头的表,这样是没问题的。
但是我在debug代码时,我修改其它数据库下的表 比如 我修改 test数据库下的表,我的客户端还是能接收到消息,消息的 entryType 只有TRANSACTIONBEGIN和TRANSACTIONEND;虽然这两个消息并不是我想要的,但是我还是希望不要收到其它数据库修改后的“垃圾”消息: 垃圾消息如下:
header {
version: 1
logfileName: "mysql-bin.000001"
logfileOffset: 6882
serverId: 1
serverenCode: "UTF-8"
executeTime: 1536320325000
sourceType: MYSQL
schemaName: ""
tableName: ""
eventLength: 75
}
entryType: TRANSACTIONBEGIN
storeValue: " \036"

@shizhengchao
Copy link
Author

我想在表达 下我的问题:
1.canal.instance.filter.regex=cms.rc_.*的确能达到我预期的效果。
2.但是其它的数据库(schema)的消息我也收到了(增删改就会收到消息),entryType 虽然没有增删改的消息,只TRANSACTIONBEGIN和TRANSACTIONEND,但我不想收到这两个消息。
3.有什么办法能解决。

@agapple
Copy link
Member

agapple commented Sep 7, 2018

有参数可以关闭, 过滤掉空事务的头和尾

@yin007008
Copy link

yin007008 commented Sep 9, 2018

在canal.properteis 里面只有一个是true 其他全部可以改为false
https://github.com/alibaba/canal/wiki/AdminGuide这里可以看
canal.instance.filter.transaction.entry = true 这个意思就是把事务头尾过滤

canal.instance.filter.query.dcl = true
canal.instance.filter.query.dml = true
canal.instance.filter.query.ddl = true
canal.instance.filter.table.error = true

这个配置就是把默认产生的sql语句给过滤掉,也就是binlog日志改为row模式后,还是会有一条EntryType为QUERY的sql语句

@shizhengchao
Copy link
Author

@yin007008 @agapple 谢谢

@johnxiaohe
Copy link

在canal.properteis 里面只有一个是true 其他全部可以改为false
https://github.com/alibaba/canal/wiki/AdminGuide这里可以看
canal.instance.filter.transaction.entry = true 这个意思就是把事务头尾过滤

canal.instance.filter.query.dcl = true
canal.instance.filter.query.dml = true
canal.instance.filter.query.ddl = true
canal.instance.filter.table.error = true

这个配置就是把默认产生的sql语句给过滤掉,也就是binlog日志改为row模式后,还是会有一条EntryType为QUERY的sql语句

您好,有点不是很明白,只有一个可以为true,其他全可以改为false的意思。他默认本身就全是false。我怎么改都不能获取正常的eventype。全是事务的eventype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants