@@ -46,7 +46,7 @@ public String getConnectionURI() {
46
46
47
47
public String getReplicationConnectionURI ( ) {
48
48
try {
49
- return getConfigConnectionURI (replicationMysql );
49
+ return getConfigReplicationConnectionURI (replicationMysql );
50
50
} catch (URISyntaxException e ) {
51
51
LOGGER .error (e .getMessage (), e );
52
52
throw new RuntimeException ("Unable to generate bootstrap's replication jdbc connection URI" , e );
@@ -65,6 +65,18 @@ private String getConfigConnectionURI(MaxwellMysqlConfig config) throws URISynta
65
65
return uriBuilder .build ().toString ();
66
66
}
67
67
68
+ private String getConfigReplicationConnectionURI (MaxwellMysqlConfig config ) throws URISyntaxException {
69
+ URIBuilder uriBuilder = new URIBuilder ();
70
+ uriBuilder .setScheme ("jdbc:mysql" );
71
+ uriBuilder .setHost (config .host );
72
+ uriBuilder .setPort (config .port );
73
+ uriBuilder .setPath ("/" + databaseName );
74
+ for (Map .Entry <String , String > jdbcOption : config .jdbcOptions .entrySet ()) {
75
+ uriBuilder .addParameter (jdbcOption .getKey (), jdbcOption .getValue ());
76
+ }
77
+ return uriBuilder .build ().toString ();
78
+ }
79
+
68
80
protected OptionParser buildOptionParser () {
69
81
OptionParser parser = new OptionParser ();
70
82
parser .accepts ( "config" , "location of config.properties file" )
0 commit comments