Skip to content

Commit f78a343

Browse files
author
yannick
committed
make JMX port configurable
1 parent e56af0f commit f78a343

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/distribution/bin/diagnostics.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ rem limitations under the License.
6565
set "JAVA_OPTS=%JAVA_OPTS% --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/sun.security.provider=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED"
6666

6767
rem JMX Monitoring
68-
set "JAVA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false %JAVA_OPTS%"
68+
IF NOT DEFINED HIVEMQ_JMX_PORT SET "HIVEMQ_JMX_PORT=9010"
69+
set "JAVA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=%HIVEMQ_JMX_PORT% -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false %JAVA_OPTS%"
6970

7071
set "JAVA_OPTS=-DdiagnosticMode=true %JAVA_OPTS%"
7172

@@ -128,4 +129,4 @@ GOTO :EOF
128129

129130
:RESOLVE
130131
SET %2=%~f1
131-
GOTO :EOF
132+
GOTO :EOF

src/distribution/bin/diagnostics.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if hash java 2>/dev/null; then
5454
fi
5555

5656
# JMX Monitoring
57-
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
57+
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=${JMX_PORT:-9010} -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
5858

5959
JAVA_OPTS="$JAVA_OPTS -DdiagnosticMode=true"
6060

src/distribution/bin/run.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ rem limitations under the License.
6565

6666

6767
rem JMX Monitoring
68-
set "JAVA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false %JAVA_OPTS%"
68+
IF NOT DEFINED HIVEMQ_JMX_PORT SET "HIVEMQ_JMX_PORT=9010"
69+
set "JAVA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=%HIVEMQ_JMX_PORT% -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false %JAVA_OPTS%"
6970

7071
rem Uncomment for enabling diagnostic mode
7172
rem set "JAVA_OPTS=-DdiagnosticMode=true %JAVA_OPTS%"
@@ -128,4 +129,4 @@ GOTO :EOF
128129

129130
:RESOLVE
130131
SET %2=%~f1
131-
GOTO :EOF
132+
GOTO :EOF

src/distribution/bin/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if hash java 2>/dev/null; then
5252
fi
5353

5454
# JMX Monitoring
55-
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
55+
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=${JMX_PORT:-9010} -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
5656

5757
# Uncomment for enabling Diagnostic Mode
5858
#JAVA_OPTS="$JAVA_OPTS -DdiagnosticMode=true"

0 commit comments

Comments
 (0)