using jmx monitor kafka topic
<p>I am using jmx to monitoring kafka topic.</p>

<pre><code>val url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://broker1:9393/jmxrmi");

 val jmxc = JMXConnectorFactory.connect(url, null);
 val mbsc = jmxc.getMBeanServerConnection();
 val messageCountObj = new ObjectName("kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,topic=mytopic");
 val messagesInPerSec = mbsc.getAttribute(messageCountObj,"MeanRate")
</code></pre>

<p>using this code I can get the MeanRate of "mytopic" on broker1.
but I have 10 brokers,how can I get the "mytopic"'s MeanRate from all my brokers?</p>

<p>I have try "service:jmx:rmi:///jndi/rmi://broker1:9393,broker2:9393,broker3:9393/jmxrmi"</p>

<p>got an error :(</p>