tzssangglass commented on a change in pull request #19: URL: https://github.com/apache/apisix-java-plugin-runner/pull/19#discussion_r642362586
########## File path: docs/how-it-works.md ########## @@ -0,0 +1,85 @@ +# How It Works + +This article explains how apisix-java-plugin-runner collaborate with [Apache APISIX](https://apisix.apache.org) to run plugins written in java. + +## Run Mode + +apisix-java-plugin-runner can be run alone or bundled with Apache APISIX. +It depends on whether you need to debug it or run it. + +### Debug + +If you are developing a new plugin and need to debug the code, then you can run the main class +[PluginRunnerApplication](https://github.com/apache/apisix-java-plugin-runner/blob/main/runner-starter/src/main/java/org/apache/apisix/plugin/runner/PluginRunnerApplication.java), +and before start, you need to set the following two environment variables: + +- APISIX_LISTEN_ADDRESS: apisix-java-plugin-runner and APISIX for inter-process communication (Unix Domain Socket) socket type file address. + And do not need to actively create this file, apisix-java-plugin-runner will automatically create this file when it starts. +- APISIX_CONF_EXPIRE_TIME: the time that APISIX's configuration is cached in the apisix-java-plugin-runner process. + +For example, if you start apisix-java-plugin-runner as a jar package, pass the environment variables as follows + +```shell +java -jar -DAPISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock -DAPISIX_CONF_EXPIRE_TIME=3600 /path/to/apisix-java-plugin-runner.jar Review comment: add refer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
