KAFKA-5843; Mx4jLoader.maybeLoad should only be executed if kafka_mx4jenable is set to true

Author: Dong Lin <lindong28@gmail.com>
Author: Ralph Weires

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3797 from lindong28/KAFKA-5843
This commit is contained in:
Dong Lin 2017-10-03 11:23:29 +01:00 committed by Ismael Juma
parent a1a5e93beb
commit 716330a5b2
2 changed files with 4 additions and 2 deletions

View File

@ -5,7 +5,7 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ -34,7 +34,7 @@ object Mx4jLoader extends Logging {
def maybeLoad(): Boolean = {
val props = new VerifiableProperties(System.getProperties())
if (props.getBoolean("kafka_mx4jenable", false))
if (!props.getBoolean("kafka_mx4jenable", false))
return false
val address = props.getString("mx4jaddress", "0.0.0.0")
val port = props.getInt("mx4jport", 8082)

View File

@ -74,6 +74,8 @@
will return <code>0.0</code> in such cases to minimise the probability of breaking users who read the value of every client
metric (via a <code>MetricsReporter</code> implementation or by calling the <code>metrics()</code> method).
<code>org.apache.kafka.common.Metric#metricValue()</code> can be used to retrieve numeric and non-numeric metric values.</li>
<li>Mx4j will only be enabled if the system property <code>kafka_mx4jenable</code> is set to <code>true</code>. Due to a logic
inversion bug, it was previously enabled by default and disabled if <code>kafka_mx4jenable</code> was set to <code>true</code>.</li>
</ul>
<h5><a id="upgrade_100_new_protocols" href="#upgrade_100_new_protocols">New Protocol Versions</a></h5>