This is an automated email from the ASF dual-hosted git repository.

cegerton pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 41d075ba140 KAFKA-14430: Specify JMX RMI port system property when not 
already set (#12898)
41d075ba140 is described below

commit 41d075ba140fbd573a55ce2b18a1b53a44703b76
Author: FUNKYE <[email protected]>
AuthorDate: Fri Dec 2 11:46:37 2022 +0800

    KAFKA-14430: Specify JMX RMI port system property when not already set 
(#12898)
    
    Reviewers: Andriy Redko <[email protected]>, Chris Egerton 
<[email protected]>
---
 bin/kafka-run-class.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index 6d8c38f9b17..fa0617f2489 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -213,6 +213,10 @@ fi
 # JMX port to use
 if [  $JMX_PORT ]; then
   KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS 
-Dcom.sun.management.jmxremote.port=$JMX_PORT "
+  if ! echo "$KAFKA_JMX_OPTS" | grep -qF -- 
'-Dcom.sun.management.jmxremote.rmi.port=' ; then
+    # If unset, set the RMI port to address issues with monitoring Kafka 
running in containers
+    KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS 
-Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
+  fi
 fi
 
 # Log directory to use

Reply via email to