class MySQLConnector {

    public synchronized void subscribe(final String binlogFileName, final long binlogPosition) {
        initDumpConnectSession();
        final int checksumLength = queryChecksumLength();
        registerSlave();
        responseCallback = null;
        BinlogDumpCommandPacket binlogDumpCmd = new BinlogDumpCommandPacket();
        binlogDumpCmd.setBinlogFileName(binlogFileName);
        binlogDumpCmd.setBinlogPosition(binlogPosition);
        binlogDumpCmd.setSlaveServerId(serverId);
        channel.pipeline().remove(MySQLCommandPacketDecoder.class);
        channel.pipeline().remove(MySQLCommandResponseHandler.class);
        channel.pipeline().addLast(new MySQLBinlogEventPacketDecoder(checksumLength));
        channel.pipeline().addLast(new MySQLBinlogEventHandler());
        channel.writeAndFlush(binlogDumpCmd);
    }

}