@@ -22,7 +22,7 @@ Setting JVM path and class path within `http {` block in nginx.conf
22
22
###define class paths
23
23
###for clojure, you should append clojure core jar
24
24
###for groovy, you should append groovy runtime jar
25
- jvm_options "-Djava.class.path=#{my_jar_root}/nginx-clojure-0.2.6 .jar";
25
+ jvm_options "-Djava.class.path=#{my_jar_root}/nginx-clojure-0.2.7 .jar";
26
26
27
27
###uncomment next two line to define jvm heap memory
28
28
#jvm_options "-Xms1024m";
@@ -332,7 +332,7 @@ three choice :
332
332
* :smiley:It's a trade off choice and almost all Java server such as Jetty, Tomcat , Glassfish etc. use thread pool to handle http requests.
333
333
* :smiley:Your old code **_need not be changed_**.
334
334
* :worried:The nginx worker will be blocked after all threads are exhuasted by slow I/O operations.
335
- * :worried:Becase the max number of threads is alwarys more smaller than the total number of socket connections supported by Operation Systems and
335
+ * :worried:Becase the max number of threads is always more smaller than the total number of socket connections supported by Operation Systems and
336
336
thread in java is costlier than coroutine, facing large amount of connections this choice isn't as good as Coroutine based choice.
337
337
338
338
### 2.4.1 Enable Coroutine based Socket
@@ -349,10 +349,10 @@ thread in java is costlier than coroutine, facing large amount of connections th
349
349
worker_processes 1;
350
350
351
351
#turn on run tool mode, t means Tool
352
- jvm_options "-javaagent:jars/nginx-clojure-0.2.6 .jar=tmb";
352
+ jvm_options "-javaagent:jars/nginx-clojure-0.2.7 .jar=tmb";
353
353
354
- #for clojure, you should append clojure core jar, e.g -Djava.class.path=jars/nginx-clojure-0.2.6 .jar:mypath-xxx/clojure-1.5.1.jar,please replace ':' with ';' on windows
355
- jvm_options "-Xbootclasspath/a: jars /nginx-clojure-0.2.6 .jar";
354
+ #for clojure, you should append clojure core jar, e.g -Djava.class.path=jars/nginx-clojure-0.2.7 .jar:mypath-xxx/clojure-1.5.1.jar,please replace ':' with ';' on windows
355
+ jvm_options "-Xbootclasspath/a: jars /nginx-clojure-0.2.7 .jar";
356
356
...
357
357
}
358
358
```
@@ -396,11 +396,11 @@ thread in java is costlier than coroutine, facing large amount of connections th
396
396
worker_processes 8;
397
397
398
398
#turn on coroutine mode
399
- jvm_options "-javaagent:jars/nginx-clojure-0.2.6 .jar=mb";
399
+ jvm_options "-javaagent:jars/nginx-clojure-0.2.7 .jar=mb";
400
400
401
401
#append nginx-clojure & clojure runtime jars to jvm bootclasspath
402
- #for win32, class path seperator is ";", e.g "-Xbootclasspath/a:jars/nginx-clojure-0.2.6 .jar;jars/clojure-1.5.1.jar"
403
- jvm_options "-Xbootclasspath/a:jars/nginx-clojure-0.2.6 .jar:jars/clojure-1.5.1.jar";
402
+ #for win32, class path seperator is ";", e.g "-Xbootclasspath/a:jars/nginx-clojure-0.2.7 .jar;jars/clojure-1.5.1.jar"
403
+ jvm_options "-Xbootclasspath/a:jars/nginx-clojure-0.2.7 .jar:jars/clojure-1.5.1.jar";
404
404
405
405
#coroutine-udfs is a directory to put your User Defined Class Waving Configuration File
406
406
#for win32, class path seperator is ";", e.g "-Djava.class.path=coroutine-udfs;YOUR_CLASSPATH_HERE"
440
440
``` nginx
441
441
442
442
#turn off coroutine mode, n means do nothing. You can also comment this line to turn off coroutine mode
443
- jvm_options "-javaagent:jars/nginx-clojure-0.2.6 .jar=nmb";
443
+ jvm_options "-javaagent:jars/nginx-clojure-0.2.7 .jar=nmb";
444
444
445
445
jvm_workers 40;
446
446
```
@@ -617,6 +617,26 @@ public class MyHandler implements NginxJavaRingHandler {
617
617
}
618
618
619
619
```
620
+
621
+ ### 2.5.4 Access request BODY in Nginx rewrite handler
622
+
623
+ Try ` always_read_body on; ` where about the location you want to access the request body in a JAVA rewrite handler.
624
+ We also added an example(for unit testing) about this, in nginx.conf
625
+
626
+ ``` nginx
627
+
628
+ set $myup "";
629
+
630
+ location /javarewritebybodyproxy {
631
+ always_read_body on;
632
+ handler_type 'java';
633
+ rewrite_handler_name 'nginx.clojure.java.RewriteHandlerTestSet4NginxJavaRingHandler$SimpleRewriteByBodyHandler';
634
+ proxy_pass http://$myup;
635
+ }
636
+ ```
637
+
638
+ The example java rewrite handler code can be found from https://github.com/nginx-clojure/nginx-clojure/blob/master/test/java/nginx/clojure/java/RewriteHandlerTestSet4NginxJavaRingHandler.java#L35
639
+
620
640
[ nginx-clojure broadcast API ] : https://github.com/nginx-clojure/nginx-clojure/issues/38
621
641
[ SharedHashMap/Chronicle-Map ] : https://github.com/OpenHFT/Chronicle-Map
622
642
[ Asynchronous Socket/Channel ] : more.html#user-content-36-asynchronous-channel
0 commit comments