Skip to content

Commit ba83f7d

Browse files
committed
update for release v0.2.7
1 parent fce4c27 commit ba83f7d

File tree

7 files changed

+421
-328
lines changed

7 files changed

+421
-328
lines changed

.settings/ccw.repl.cmdhistory.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
cmdhistory=["(render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/QuickStart.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/CoreFeatures.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/Installation.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/More.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/QuickStart.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/UserfullLinks.md\\")"]
1+
cmdhistory=["(render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\" )" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/QuickStart.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/CoreFeatures.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/Installation.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/More.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/QuickStart.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/UserfullLinks.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/More.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/QuickStart.md\\")" "(render-md-file \\"/home/who/git/workflow-server/README.md\\")" " (render-md-file \\"/home/who/git/workflow-server/README.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/CoreFeatures.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/CoreFeatures.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/HISTORY.md\\")" "(render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\")" " (render-md-file \\"/home/who/git/nginx-clojure.github.io/Configuration.md\\")"]
22
eclipse.preferences.version=1

Configuration.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Setting JVM path and class path within `http {` block in nginx.conf
2222
###define class paths
2323
###for clojure, you should append clojure core jar
2424
###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";
2626
2727
###uncomment next two line to define jvm heap memory
2828
#jvm_options "-Xms1024m";
@@ -332,7 +332,7 @@ three choice :
332332
* :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.
333333
* :smiley:Your old code **_need not be changed_**.
334334
* :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
336336
thread in java is costlier than coroutine, facing large amount of connections this choice isn't as good as Coroutine based choice.
337337

338338
### 2.4.1 Enable Coroutine based Socket
@@ -349,10 +349,10 @@ thread in java is costlier than coroutine, facing large amount of connections th
349349
worker_processes 1;
350350

351351
#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";
353353

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";
356356
...
357357
}
358358
```
@@ -396,11 +396,11 @@ thread in java is costlier than coroutine, facing large amount of connections th
396396
worker_processes 8;
397397
398398
#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";
400400

401401
#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";
404404

405405
#coroutine-udfs is a directory to put your User Defined Class Waving Configuration File
406406
#for win32, class path seperator is ";", e.g "-Djava.class.path=coroutine-udfs;YOUR_CLASSPATH_HERE"
@@ -440,7 +440,7 @@ eg.
440440
```nginx
441441
442442
#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";
444444
445445
jvm_workers 40;
446446
```
@@ -617,6 +617,26 @@ public class MyHandler implements NginxJavaRingHandler {
617617
}
618618

619619
```
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+
620640
[nginx-clojure broadcast API]: https://github.com/nginx-clojure/nginx-clojure/issues/38
621641
[SharedHashMap/Chronicle-Map]: https://github.com/OpenHFT/Chronicle-Map
622642
[Asynchronous Socket/Channel]: more.html#user-content-36-asynchronous-channel

0 commit comments

Comments
 (0)