File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/main/java/com/github/shyiko/mysql/binlog Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ public class BinaryLogClient implements BinaryLogClientMXBean {
8888 private long serverId = 65535 ;
8989 private volatile String binlogFilename ;
9090 private volatile long binlogPosition = 4 ;
91+ private volatile long connectionId ;
9192
9293 private GtidSet gtidSet ;
9394 private final Object gtidSetAccessLock = new Object ();
@@ -212,6 +213,13 @@ public void setBinlogPosition(long binlogPosition) {
212213 this .binlogPosition = binlogPosition ;
213214 }
214215
216+ /**
217+ * @return thread id
218+ */
219+ public long getConnectionId () {
220+ return connectionId ;
221+ }
222+
215223 /**
216224 * @return GTID set. Note that this value changes with each received GTID event (provided client is in GTID mode).
217225 * @see #setGtidSet(String)
@@ -359,9 +367,10 @@ public void connect() throws IOException {
359367 throw e ;
360368 }
361369 connected = true ;
370+ connectionId = greetingPacket .getThreadId ();
362371 if (logger .isLoggable (Level .INFO )) {
363372 logger .info ("Connected to " + hostname + ":" + port + " at " + binlogFilename + "/" + binlogPosition +
364- " (sid:" + serverId + ", cid:" + greetingPacket . getThreadId () + ")" );
373+ " (sid:" + serverId + ", cid:" + connectionId + ")" );
365374 }
366375 synchronized (lifecycleListeners ) {
367376 for (LifecycleListener lifecycleListener : lifecycleListeners ) {
You can’t perform that action at this time.
0 commit comments