}
}
*/
- public String createMirrorMaker() {
+ public String createMirrorMaker( String consumerPort, String producerPort ) {
StringBuilder str = new StringBuilder( "{ \"messageID\": \"" + MirrorMakerService.genTransactionId() + "\", \"createMirrorMaker\": {" );
str.append( " \"name\": \"" + this.getMmName() + "\", " );
- str.append( " \"consumer\": \"" + this.sourceCluster + ":2181\", " );
- str.append( " \"producer\": \"" + this.targetCluster + ":9092\" ");
+ str.append( " \"consumer\": \"" + this.sourceCluster + ":" + consumerPort + "\", " );
+ str.append( " \"producer\": \"" + this.targetCluster + ":" + producerPort + "\" ");
str.append( " } }" );
public void addTopic( String topic ) {
- topics.add(topic);
+ if ( ! topics.contains(topic)) {
+ topics.add(topic);
+ }
+ logger.info( "Mirrormaker.addTopic: topic=" + topic + " . Now have " + topics.size() + " topics" );
}
public int getTopicCount() {