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

方法updateClientBinlogFilenameAndPosition和updateGtidSet等方法一样,可以被按需重写 #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xzxiaoshan
Copy link

方法updateClientBinlogFilenameAndPosition和updateGtidSet等方法一样,可以被按需重写。 例如,重写该方法并添加对 binlogFileName 和 position 进行持久化。当服务宕机重启后可以从持久化中读取并继续。

例如:

        BinaryLogClient client = new BinaryLogClient(binLogProperties.getHost(), binLogProperties.getPort(),
                binLogProperties.getUsername(), binLogProperties.getPassword()) {

            @Override
            private void updateClientBinlogFilenameAndPosition(Event event) {
                super.updateClientBinlogFilenameAndPosition(event);
                // 将binlogFileName和position持久化记录,在服务宕机重启后读取并继续
                // (略)
            }
        };

方法updateClientBinlogFilenameAndPosition和updateGtidSet等方法一样,可以被按需重写。
例如,重写该方法并添加对 binlogFileName 和 position 进行持久化。当服务宕机重启后可以从持久化中读取并继续。

例如:
```
        BinaryLogClient client = new BinaryLogClient(binLogProperties.getHost(), binLogProperties.getPort(),
                binLogProperties.getUsername(), binLogProperties.getPassword()) {

            @OverRide
            private void updateClientBinlogFilenameAndPosition(Event event) {
                super.updateClientBinlogFilenameAndPosition(event);
                // 将binlogFileName和position持久化记录,在服务宕机重启后读取并继续
                // (略)
            }
        };
```
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

Successfully merging this pull request may close these issues.

1 participant