Download page WSO2 API Microgateway Startup Settings.
WSO2 API Microgateway Startup Settings
You can instrument WSO2 API Microgateway by adding the Java Agent to JVM arguments in the executable file of the gateway. Perform the following steps based on your environment to attach the Java Agent:
Java Agent supports only the HTTP1 protocol for entry and exit.
Open the executable file named "gateway" at <MGW_HOME>/bin in a text editor.
In java_cmd_gateway () under $JAVA_OPTS, add :
-javaagent:/path_to_appagent/javaagent.jar
CODE
Save the executable and start the gateway.
Navigate to the docker container in which the microgateway is running using the following command:
docker exec -it <container_id> /bin/bash
CODE
Open the executable file named "gateway" at wso2/bin inside the docker container in a text editor.
In java_cmd_gateway () under $JAVA_OPTS, add :
-javaagent:/path_to_appagent/javaagent.jar
CODE
Save the gateway file.
Fetch the process id of Java process running inside the container using the following command:
ps -eaf | grep java
CODE
Kill the process <process_ID>:
kill -9 <process_ID>
CODE
Start the gateway again by running the jar:
wso2/bin/gateway <executable_jar>
CODE
Open the executable file named "gateway" at <MGW_HOME>/bin in a text editor.
In runTools under "SET JAVA_CMD", after "%JAVA_OPTS% ^" add the following: