WSO2 API Microgateway のスタートアップ設定

ゲートウェイの実行可能ファイルの JVM 引数に Java エージェントを追加することで、WSO2 API Microgateway をインストゥルメント化できます。Java エージェントをアタッチするには、環境に応じて次の手順を実行します。

注: Java エージェントは、エントリとイグジットで HTTP1 プロトコルのみをサポートします。

Add the Java Agent in Linux or macOS

  1. Open the executable file named "gateway" at <MGW_HOME>/bin in a text editor.
  2. In java_cmd_gateway () under $JAVA_OPTS, add :
    -javaagent:/path_to_appagent/javaagent.jar
  3. Save the executable and start the gateway.

Add the Java Agent in Docker

  1. Navigate to the docker container in which the microgateway is running using the following command:
    docker exec -it <container_id> /bin/bash
  2. Open the executable file named "gateway" at wso2/bin inside the docker container in a text editor.
  3. In java_cmd_gateway () under $JAVA_OPTS, add :
    -javaagent:/path_to_appagent/javaagent.jar
  4. Save the gateway file.
  5. Fetch the process id of Java process running inside the container using the following command:
    ps -eaf | grep java
  6. Kill the process <process_ID>:
    kill -9 <process_ID>
  7. Start the gateway again by running the jar:
    wso2/bin/gateway <executable_jar>

Add the Java Agent in Windows

  1. Open the executable file named "gateway" at <MGW_HOME>/bin in a text editor.
  2. In runTools under "SET JAVA_CMD", after "%JAVA_OPTS% ^" add the following:
    -javaagent:/path_to_appagent/javaagent.jar
  3. Save the executable and start the gateway.