I have been currently trying to connect VisualVM (A program which monitors the JVM, heap and memory usage etc) to a Spring Boot Application (Java App) running on AWS Fargate in Docker containers.
I have been exposing the JMX ports accordingly and I am able to connect through the JMX ports when running the Docker container locally. However, when running the Java App on Fargate, I have not found a way to connect to the Container through JMX. I have tried setting the VM argument -Djava.rmi.server.hostname to the IP Address of the container, but when I try to connect through JMX it still fails to do so. Has anyone had any experience with this?
JMX commands for reference:
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname=172.17.0.2 \
-Dcom.sun.management.jmxremote.port=9090\
-Dcom.sun.management.jmxremote.rmi.port=9090\
-jar java-api.jar server