tzssangglass commented on a change in pull request #19:
URL: 
https://github.com/apache/apisix-java-plugin-runner/pull/19#discussion_r642272212



##########
File path: docs/development.md
##########
@@ -0,0 +1,119 @@
+Development
+
+This document explains how to get started to develop the 
apisix-java-plugin-runner.
+
+Prerequisites
+-------------
+
+* JDK 8
+* APISIX 2.6.0
+* Clone the 
[apisix-java-plugin-runner](https://github.com/apache/apisix-java-plugin-runner)
 project.
+* Refer to [Debug](how-it-works.md#debug)  to build the debug environment.
+
+Install
+-------
+
+```shell
+cd /path/to/apisix-java-plugin-runner
+./mvnw install
+```
+
+Write Filter
+------------
+
+Refer to the code in the 
[sample](https://github.com/apache/apisix-java-plugin-runner/tree/main/sample)
+to learn how to extend `PluginFilter`, define the order, rewrite requests and 
stop requests.
+
+####  Code Location
+
+You need to put the code in 
[runner-plugin-sdk](https://github.com/apache/apisix-java-plugin-runner/tree/main/runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner)
+so that the `apisix-java-plugin-runner.jar` will contain the filter 
implementation class you wrote when you package it.
+
+####  The order of filter execution
+
+The order of execution of the filter in the runner is determined by the index 
of the `conf` array in the `ext-plugin-pre-req` or `ext-plugin-post-req` 
configuration.
+
+####  The name of filter execution
+
+The requests go through filters that are dynamically configured on APISIX.
+For example, if the following configuration is done on APISIX
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri":"/hello",
+    "plugins":{
+        "ext-plugin-pre-req":{
+            "conf":[
+                {
+                    "name":"FooFilter",
+                    "value":"bar"
+                }
+            ]
+        }
+    },
+    "upstream":{
+        "nodes":{
+            "127.0.0.1:1980":1
+        },
+        "type":"roundrobin"
+    }
+}'
+```
+
+apisix-java-plugin-runner will look for implementation classes named 
`FooFilter`,
+and the name of each filter's implementation class is the return value of its 
overridden function `public String name()`.
+
+
+####  Rewrite Request
+
+If you perform the following function call in the filter chain of the 
implementation class
+
+*  request.setPath()
+*  request.setHeader()
+*  request.setArg()

Review comment:
       update, here 
https://github.com/apache/apisix-java-plugin-runner/pull/19/files#diff-a09a8ee05234dc648f35846a4ddc8f94da78c228642c6226431d51540c092353R243-R265




-- 
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]


Reply via email to