use of org.apache.rocketmq.mysql.position.BinlogPosition in project rocketmq-externals by apache.
the class EventProcessor method checkConnection.
private void checkConnection() throws Exception {
if (!binaryLogClient.isConnected()) {
BinlogPosition binlogPosition = replicator.getNextBinlogPosition();
if (binlogPosition != null) {
binaryLogClient.setBinlogFilename(binlogPosition.getBinlogFilename());
binaryLogClient.setBinlogPosition(binlogPosition.getPosition());
}
binaryLogClient.connect(3000);
}
}
use of org.apache.rocketmq.mysql.position.BinlogPosition in project rocketmq-externals by apache.
the class EventProcessor method processXidEvent.
private void processXidEvent(Event event) {
EventHeaderV4 header = event.getHeader();
XidEventData data = event.getData();
String binlogFilename = binaryLogClient.getBinlogFilename();
Long position = header.getNextPosition();
Long xid = data.getXid();
BinlogPosition binlogPosition = new BinlogPosition(binlogFilename, position);
transaction.setNextBinlogPosition(binlogPosition);
transaction.setXid(xid);
replicator.commit(transaction, true);
transaction = new Transaction(config);
}
Aggregations