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

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


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

commit efea07648d16f31f00a620138e4052e837c30cc1
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 490f930b8cc..97ef0f5e8f0 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