Skip to content

Commit

Permalink
Cleanup unnecessary env variables.
Browse files Browse the repository at this point in the history
Removed env file and use JAVA_TOOL_OPTIONS instead to pass JMX options to ActiveMQ
  • Loading branch information
robsunday committed Oct 18, 2024
1 parent 36bc5aa commit 3f7d02f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.utility.MountableFile;

public class ActiveMqIntegrationTest extends TargetSystemIntegrationTest {

Expand All @@ -24,13 +23,8 @@ protected GenericContainer<?> createTargetContainer(int jmxPort) {
new ImageFromDockerfile()
.withDockerfileFromBuilder(
builder -> builder.from("apache/activemq-classic:5.18.6").build()))
.withEnv("LOCAL_JMX", "no")
.withCopyFileToContainer(
// Overwrite default ActiveMQ configuration in order to let ActiveMQ use JMX options
// stored in $ACTIVEMQ_JMX_OPTS env variable defined below
MountableFile.forClasspathResource("activemq/env"), "/opt/apache-activemq/bin/env")
.withEnv(
"ACTIVEMQ_JMX_OPTS",
"JAVA_TOOL_OPTIONS",
"-Dcom.sun.management.jmxremote.port="
+ jmxPort
+ " -Dcom.sun.management.jmxremote.rmi.port="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ protected GenericContainer<?> createTargetContainer(int jmxPort) {
"https://tomcat.apache.org/tomcat-9.0-doc/appdev/sample/sample.war",
"/usr/local/tomcat/webapps/ROOT.war")
.build()))
.withEnv("LOCAL_JMX", "no")
.withEnv(
"CATALINA_OPTS",
"-Dcom.sun.management.jmxremote.local.only=false"
Expand Down
119 changes: 0 additions & 119 deletions jmx-scraper/src/main/resources/activemq/env

This file was deleted.

0 comments on commit 3f7d02f

Please sign in to comment.