// Listen for brokers changing.
this.producerZooKeeper.onBrokerChange(topic, this);
}
final Set<String> resultSet = intersect(brokerUrls);
if (resultSet.isEmpty()) {
throw new InvalidBrokerException("Could not select a common broker url for topics:" + this.publishedTopics);
}
String[] newUrls = resultSet.toArray(new String[resultSet.size()]);
Arrays.sort(newUrls);
// Set new urls array.
this.urls = newUrls;