File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,31 @@ public class MySQLListener implements SQLExecuteListener {
125125DBStreamContext . getInstance(). addListener(new MySQLListener ());
126126```
127127
128- ### 5. 查看表或情况表缓存数据(可选)
128+ ### 5. 通过设置DBTableSupportProvider订阅对那些表进行监听(可选)
129+
130+ ```
131+
132+ import com.codingapi.dbstream.scanner.DbTable;
133+
134+ import java.util.Properties;
135+
136+ public class DefaultDBTableSupportProvider implements DBTableSupportProvider {
137+
138+ @Override
139+ public boolean support(Properties info, DbTable dbTable) {
140+ if (dbTable.hasColumns() && dbTable.hasPrimaryKeys()) {
141+ return true;
142+ }
143+ return false;
144+ }
145+ }
146+
147+
148+ ```
149+
150+ 根据表名等信息来决定是否进行数据事件解析。仅当返回true的才会进行事件推送。DefaultDBTableSupportProvider为默认的实现机制。
151+
152+ ### 6. 查看表或情况表缓存数据(可选)
129153
130154在项目启动以后,会在项目的根路径下创建dbstream文件夹,文件夹中存储的内容为数据库的表扫描缓存数据。
131155文件夹的名称为jdbcKey的字段,文件夹下的内容为缓存的表结构信息,当表结构发生变化以后可以删除对应的文件进行更新。
You can’t perform that action at this time.
0 commit comments