Nginx module for embedding Clojure or Java or Groovy programs, typically those Ring based handlers.

Overview

Nginx-Clojure

Build Status Clojars Project BSD licensed GitHub last commit SourceForge

Alt text Nginx-Clojure is a Nginx module for embedding Clojure or Java or Groovy programs, typically those Ring based handlers.

Core Features

The latest release is v0.5.2, more detail changes about it can be found from Release History.

  1. Compatible with Ring and obviously supports those Ring based frameworks, such as Compojure etc.
  2. Http Services by using Clojure / Java / Groovy to write simple handlers for http services.
  3. Nginx Access Handler by Clojure / Java / Groovy
  4. Nginx Header Filter by Clojure / Java / Groovy
  5. Nginx Body Filter by Clojure / Java / Groovy
  6. NEW: Nginx Log Handler by Clojure / Java / Groovy
  7. NEW: HTTP V2 support in both standard edition and embedded edition which are compiled against Nginx 1.18.0
  8. NEW: Support Java 9, 10, 11, 12
  9. Pub/Sub Among Nginx Worker Processes
  10. Shared Map based on shared memory & Shared Map based Ring session store
  11. Support Sente, see this PR
  12. Support Per-message Compression Extensions (PMCEs) for WebSocket
  13. APIs for Embedding Nginx-Clojure into a Standard Clojure/Java/Groovy App
  14. Server Side Websocket
  15. A build-in Jersey container to support java standard RESTful web services (JAX-RS 2.0)
  16. Tomcat 8 embedding support (so servlet 3.1/jsp/sendfile/JSR-356 websocket work within nginx!)
  17. Dynamic proxying by using Clojure / Java / Groovy to write a simple nginx rewrite handler to set var or return errors before proxy pass or content ring handler
  18. Non-blocking coroutine based socket which is Compatible with Java Socket API and works well with largely existing java library such as apache http client, mysql jdbc drivers. With this feature one java main thread can handle thousands of connections.
  19. Handle multiple sockets parallel in sub coroutines, e.g. we can invoke two remote services at the same time.
  20. Asynchronous callback API of socket/Channel for some advanced usage
  21. Long Polling & Server Sent Events
  22. Run initialization clojure code when nginx worker starting
  23. Support user defined http request method
  24. Compatible with the Nginx lastest most stable version 1.18.0. (Nginx 1.14.x, 1.12.x, 1.8.x, 1.6.x, 1.4.x is also ok, older version is not tested and maybe works.)
  25. One of benifits of Nginx is worker processes are automatically restarted by a master process if they crash
  26. Utilize lazy headers and direct memory operation between Nginx and JVM to fast handle dynamic contents from Clojure or Java code.
  27. Utilize Nginx zero copy file sending mechanism to fast handle static contents controlled by Clojure or Java code.
  28. Support Linux x64, Linux x86 32bit, Win32, Win64 and Mac OS X. Freebsd version can also be got from Freebsd ports.

By the way it is very fast, the benchmarks can be found HERE(with wrk2).

Jar Repository

Nginx-Clojure has already been published to https://clojars.org/ whose maven repository is

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>

After adding clojars repository, you can reference nginx-clojure 0.5.2 , e.g.

Leiningen (clojure, no need to add clojars repository which is a default repository for Leiningen)

[nginx-clojure "0.5.2"]

Gradle (groovy/java)

compile "nginx-clojure:nginx-clojure:0.5.2"

Maven

<dependency>
  <groupId>nginx-clojure</groupId>
  <artifactId>nginx-clojure</artifactId>
  <version>0.5.2</version>
</dependency>

Documents

License

Copyright © 2013-2020 Zhang, Yuexiang (xfeep) and released under the BSD 3-Clause license.

This program uses:

  • Re-rooted ASM bytecode engineering library which is distributed under the BSD 3-Clause license
  • Modified Continuations Library Written by Matthias Mann is distributed under the BSD 3-Clause license
Comments
  • On MacOSX thread pool mode doesn't work with Nginx 1.10.2+

    On MacOSX thread pool mode doesn't work with Nginx 1.10.2+

    I'm seeing the following all over my in my nginx error.log file. And the file size grows very quickly. built nginx-clojure module. nginx version is 1.11.6

    2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument) 2017/01/17 11:59:58 [alert] 92272#0: kevent() failed (22: Invalid argument)

    bug 
    opened by knasim 15
  • nginx reload will cause connection reset without response

    nginx reload will cause connection reset without response

    1. Write a handler to return the response in a certain time (60s).
    2. start nginx-clojure server with correct configurations
    3. curl the url
    4. do nginx-clojure reload to refresh configurations

    Except: The curl should get the correct response.

    Actual: The curl failed with empty response with tcpdump, nginx-clojure reset the connection after the handler return.

    bug 
    opened by sunjunzero 14
  • Worker Processes not freeing Memory, possible memory leak?

    Worker Processes not freeing Memory, possible memory leak?

    Hi Xfeep,

    I currently have a problem with Nginx-Clojure and am hoping you can help. I am using Nginx-Clojure as a Java-ring-handler to communicate between our Frontend & Database.

    Their are several Java methods which I call via a HTTP request to recieve data from an old DB, parse it & send send it to our new DB. This would be our heaviest process & once completed the Memory never gets freed from the Nginx Workers. Basically after a few days Nginx will crash due to lack of memory.

    I have checked over as much as possible over the last 2 months to find the problem. The Java code itself is unfortunately not the problem. Examples of the code can be given if necessary.

    I am stumped and need help :(

    If any details are missing I will get them for you: Nginx Version: 1.8.0 Nginx-Clojure: 0.4.4 Centos 7 (Docker Container)

    Nginx Config: See attachment' nginx.conf.txt

    opened by LethalMaus 12
  • jmxremote

    jmxremote

    Tried to set these via jvm_options (nginx.conf) but unable to do so and worker process is not spawned

    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=<port#> -Djava.rmi.server.hostname=<server-ip>

    It should accept them perhaps combination ?

    Creates the following message in errors.log jvm may be mad for wrong options!

    looked in /tmp and there is thread dump.

    opened by knasim 12
  • Cannot start nginx-clojure in a docker container

    Cannot start nginx-clojure in a docker container

    I deployed nginx-clojure as docker container.

    I get always the following error:

    Error: Could not find or load main class nginx.clojure.DiscoverJvm
    nginx: [error] detect jvm error, cmd : java -Djava.class.path=libs/mytest-0.0.1-SNAPSHOT.jar:libs/res: nginx.clojure.DiscoverJvm, result :
    nginx: [error] can not find installed JRE/JDK
    

    Dockerfile is:

    FROM openjdk:8-jdk
    ADD src/main/resources/nginx-clojure-0.4.4.tar.gz /etc/
    COPY src/main/resources/nginx.conf /etc/nginx-clojure-0.4.4/conf/
    RUN chmod 777 /etc/nginx-clojure-0.4.4 -R
    COPY target/mytest-0.0.1-SNAPSHOT.jar /etc/nginx-clojure-0.4.4/libs/
    WORKDIR "/etc/nginx-clojure-0.4.4"
    CMD ["./nginx-linux-x64", "-g", "daemon off;"]
    

    nginx.conf

    ###you can uncomment next two lines for easy debug
    ###Warning: if master_process is off, there will be only one nginx worker running. Only use it for debug propose.
    
    #daemon  off;
    
    #master_process  off;
    
    #user  nobody;
    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #access_log  logs/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #gzip  on;
        
    
        jvm_path auto;
        
        ### Set my app jars and resources, it must include nginx-clojure runtime jar,e.g. nginx-clojure-0.4.4.jar and 
        ### for clojure user clojure runtime jar is also needed.
        ### See http://nginx-clojure.github.io/directives.html#jvm_classpath
        jvm_classpath "jars/nginx-clojure-0.4.4.jar:libs/*;
        
        ###jvm heap memory
        #jvm_options "-Xms1024m";
        #jvm_options "-Xmx1024m";
        
        #for enable java remote debug uncomment next two lines
        #jvm_options "-Xdebug";
        #jvm_options "-Xrunjdwp:server=y,transport=dt_socket,address=840#{pno},suspend=n";
    
        ###threads number for request handler thread pool on jvm, default is 0. 
        ###check more details from 
        #jvm_workers 8;
    
        server {
            listen       8080;
            server_name  localhost;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
            location / {
                root   html;
                index  index.html index.htm;
            }
    
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
           location /clojure {
              handler_type 'clojure';
              handler_code ' 
    						(fn[req]
    						  {
    						    :status 200,
    						    :headers {"content-type" "text/plain"},
    						    :body  "Hello Clojure & Nginx!" 
    						    })
              ';
           }
           
    #      location /groovy {
    #          handler_type 'groovy';
    #          handler_code ' 
    #               import nginx.clojure.java.NginxJavaRingHandler;
    #               import java.util.Map;
    #               public class HelloGroovy implements NginxJavaRingHandler {
    #                  public Object[] invoke(Map<String, Object> request){
    #                     return [200, //http status 200
    #                             ["Content-Type":"text/html"], //headers map
    #                             "Hello, Groovy & Nginx!"]; //response body can be string, File or Array/Collection of them
    #                  }
    #               }
    #          ';
    #       }
    #       
           
        }
    
    }
    

    Any idea?? Thanks in advance

    opened by ikercrg 11
  • rewrite_handler_name does not work without content handler

    rewrite_handler_name does not work without content handler

    rewrite_handler_name & rewrite_handler_code don't work without handler_code or handler_name

    This example does not work

            set $destination "should_get_overwritten";
            location / {
               resolver 8.8.8.8;
               handler_type 'java';
               rewrite_handler_name 'my.ProxyHandler';
               proxy_pass $destination;
            }
    

    But old directive clojure & clojure_rewrite_code works. e.g. This example works

            set $destination "should_get_overwritten";
            location / {
               resolver 8.8.8.8;
               clojure;
               clojure_rewrite_code '
               (do 
                          (require \'[my.clj-handler :as m])
                          m/clj-proxy-handler)';        
               proxy_pass $destination;
            }
    

    Thanks Eric Kubacki for finding this bug.

    bug 
    opened by xfeep 11
  • Using the asynchronous socket mode

    Using the asynchronous socket mode

    Hi, I am very interested in using the async sockets you provide to the client libs. If I use them with core.async, will core.async still initialize its own thread pool and run its go blocks there? If not, could you make an example of the async sockets used in Clojure?

    question 
    opened by dgrnbrg 11
  • Usage Issue

    Usage Issue

    I have tried to compile nginx-clojure via Ubuntu 12.04's build tool, but everytime I try to hit the /clojure location, I have a Method not found exception.

    Oddly, I have a 16KB .jar file, compared to the binary one which is 42KB. I have placed the jars into /etc/nginx/jars.

    Exception in thread "main" java.lang.NoSuchMethodError: Method nginx.clojure.NginxClojureRT.ngx_create_file_buf(JJJI)J not found 2014/01/19 16:45:30 [error] 31648#0: can not initialize jvm memory util

    Any Ideas?

    question 
    opened by lunkdjedi 11
  • Cannot run Groovy (external) example routine. Inline code runs fine

    Cannot run Groovy (external) example routine. Inline code runs fine

    Hi,

    I am having a problem with running the external "groovy" example routine. Using the inline option it works fine. I have checked permissions, and the code itself which is straight out of the Nginx 3rd Party modules example list. When trying to run this via an external routine it fails. I have checked paths and copied the external code into a mytest subdirectory as from another issue logged.

        This section fails
        location /groovy {
                handler_type 'groovy';
                handler_name 'mytest.HelloGroovy';
        }
    
        This section "Works" when un-commented:
        #location /groovy {
        #       handler_type 'groovy';
        #       handler_code '
        #       import nginx.clojure.java.NginxJavaRingHandler;
        #       import java.util.Map;
        #               public class HelloGroovy implements NginxJavaRingHandler {
        #                       public Object[] invoke(Map<String, Object> request){
        #                               return [200, //http status 200
        #                                       ["Content-Type":"text/html"], //headers map
        #                                       "Hello, Groovy & NGINX!"]; //response body can be string, File or Array/Collection of them
        #                       }
        #               }
        #       ';
        #}
    

    which produces 2017/12/22 11:11:21 [error] 23789#23789: invalid groovy content_handler code : mytest.HelloGroovy 2017/12/22 11:11:22 [alert] 23787#23787: worker process 23789 exited with fatal code 2 and cannot be respawned

    Would be grateful if someone could advise.

    Patrick

    opened by mchalep 10
  • Old compojure dependecy

    Old compojure dependecy

    NginxEmbedServer spins off with old version of compojure, which still has the middleware ordering bug (https://github.com/weavejester/compojure/pull/157).

    nginx-clojure for some reason depends on compojure 1.1.6, which is really ancient.

    opened by SergeyKozachenko 10
  • not working @ macosx

    not working @ macosx

    2016-04-01 22:15:50.328 nginx-macosx[7910:1036829] The application with bundle ID (null) is running setugid(), which is not allowed. 2016/04/01 22:15:50 [error] 7911#0: jvm may be mad for wrong options! See hs_err_pid****.log for detail! restarted 2 2016/04/01 22:15:50 [alert] 6054#0: worker process 7911 exited with fatal code 2 and cannot be respawned

    opened by ryanjin 10
  • Bump spring-web from 5.3.19 to 6.0.0 in /example-projects/jersey-spring-example

    Bump spring-web from 5.3.19 to 6.0.0 in /example-projects/jersey-spring-example

    Bumps spring-web from 5.3.19 to 6.0.0.

    Release notes

    Sourced from spring-web's releases.

    v6.0.0

    See What's New in Spring Framework 6.x and Upgrading to Spring Framework 6.x for upgrade instructions and details of new features.

    :star: New Features

    • Avoid direct URL construction and URL equality checks #29486
    • Simplify creating RFC 7807 responses from functional endpoints #29462
    • Allow test classes to provide runtime hints via declarative mechanisms #29455

    :notebook_with_decorative_cover: Documentation

    • Align javadoc of DefaultParameterNameDiscoverer with its behavior #29494
    • Document AOT support in the TestContext framework #29482
    • Document Ahead of Time processing in the reference guide #29350

    :hammer: Dependency Upgrades

    • Upgrade to Reactor 2022.0.0 #29465

    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​ophiuhus and @​wilkinsona

    v6.0.0-RC4

    :star: New Features

    • Introduce DataFieldMaxValueIncrementer for SQL Server sequences #29447
    • Introduce findAllAnnotationsOnBean variant on ListableBeanFactory #29446
    • Introduce support for Jakarta WebSocket 2.1 #29436
    • Allow @ControllerAdvice in WebFlux to handle exceptions before a handler is selected #22991

    :lady_beetle: Bug Fixes

    • Bean with unresolved generics do not use fallback algorithms with AOT #29454
    • TomcatRequestUpgradeStrategy is not compatible with Tomcat 10.1 #29434
    • Autowiring of a generic type produced by a factory bean fails after AOT processing #29385

    :notebook_with_decorative_cover: Documentation

    • Reference PDF containing full docs not available #28451

    :hammer: Dependency Upgrades

    • Revisit Servlet API baseline: Servlet 6.0 in the build, Servlet 5.0 compatibility at runtime #29435
    • Upgrade to Context Propagation 1.0.0 #29442
    • Upgrade to Jackson 2.14.0 #29351
    • Upgrade to Micrometer 1.10.0 #29441

    ... (truncated)

    Commits
    • 5a30a43 Release v6.0.0
    • 42856ba Add milestone repo for optional Netty 5 support
    • 9be6cea Polishing deprecated methods
    • 37b4391 Align javadoc of DefaultParameterNameDiscoverer with its behavior
    • 09a58a5 Polish
    • 10f4ad1 Assert fixed in DefaultErrorResponseBuilder
    • 9457ed3 Document AOT support in the TestContext framework
    • 074ec97 Fix section formatting in the testing chapter
    • 9ede4af Revert "Ignore HttpComponents Javadoc"
    • bfc1251 Merge branch '5.3.x'
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Run on JDK 1.17, 1.19

    Run on JDK 1.17, 1.19

    To run nginx-clojure on JDK 1.17, 1.19 we need add jvm options in nginx.conf, e.g.

        jvm_options "--add-opens=java.base/java.lang=ALL-UNNAMED";
        jvm_options "--add-opens=java.base/sun.nio.cs=ALL-UNNAMED";
        jvm_options "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED";
    
    question 
    opened by xfeep 2
  • More context  support

    More context support

    Hi,Zhang! Will it be possible to support the use of content_handler, rewrite_handler, access_handler, header_filter, body_filter and other methods in the context of http and server level in the future? Just like the openresty's access_by_lua_block、header_filter_by_lua_block、body_filter_by_lua_block etc.

    feature 
    opened by shook2012 2
  • Can you provide a detailed nginx-clojure-embed compilation process ?

    Can you provide a detailed nginx-clojure-embed compilation process ?

    Since the release version does not support the ip_hash feature, I want to try to compile.

    nginx-1.23.1
    pcre-8.45
    openssl-3.0.5
    msvc cl 19.29
    perl-5.32.1
    

    I successfully compiled nginx.exe with this environment.

    Progress

    I execute /nginx-clojure-embed/configure-win32 , it output ..

    creating xxxxxxx/nginx-compile/nginx-clojure/nginx-clojure-embed\Makefile
    done
    please try make to compile shared library of nginx-clojure-embed
    please modify xxxxx/nginx-compile/nginx/auto/lib/sha1/makefile.msvc to add openssl sha headers
    ./configure-win32: line 149: LIBC: command not found
    ./configure-win32: line 149: CPU_OPT: command not found
    CFLAGS = -nologo -O2 -Ob1 -Oi -Gs   -D L_ENDIAN -I xxxxxx/nginx-compile/nginx/objs/lib/openssl-3.0.5/openssl/include -I xxxxxx/nginx-compile/nginx/objs/lib/openssl-3.0.5/crypto
    

    But the current version of nginx no longer exists lib/sha1/makefile.msvc so idk how do it, Or can you provide support ip_hash nginx (dll/so/dylib) ?

    opened by xtherk 8
  • Is it possible to add a new header before the proxy request is sent?

    Is it possible to add a new header before the proxy request is sent?

    Hello!

    I'm trying to create a rewrite filter that will add a new header that gets passed down to the proxy endpoint. It appears that the headers are read only for the filter. Is this intended, or was there a way to add this I just haven't been able to discover?

    Thanks!

    opened by baens 1
Releases(v0.5.3)
  • v0.5.3(Mar 10, 2022)

    0.5.3 (2022-03-10)

    1. Bug Fix: #256 NginxClojureAsynSocket isClosed is not return correct result
    2. Binaries Distribution: Built with Nginx v1.20.2
    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Dec 23, 2020)

    0.5.2 (2020-12-23)

    1. Bug Fix: #234 Try to fix no response when NGX_AGAIN return at next header filter
    2. Bug Fix: #233 Fix compiler warnings when there's no zlib found
    3. Enhancement: Delayed update to improve setVariable/set-ngx-var! performance at thread-pool mode
    4. Example Project: Add an example project for Jersey & Spring DI
    5. Example Project: Add example for integration with Spring framework
    6. Binaries Distribution: Built with Nginx v1.18.0
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Nov 23, 2019)

    0.5.1 (2019-11-23)

    1. Bug Fix: Connection hangs with header filter at thread-pool mode #209 #153
    2. Bug Fix: Body filter hangs when body size is larger than the value specified in proxy_buffers #219
    3. Bug Fix: Segment fault caused by request is marked as closed too late #222
    4. Code Style: Fix generic warnings in java code code-style #223 (Thanks to Michael @mgoblin)
    5. Bug Fix: NPE caused by damaged memory because unsafe modify response headers #198
    6. Bug Fix: Wrong response for uncompressed message with PMCE enabled #163
    7. CI: both auto-triggered unit test and integration test use travis-ci
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Oct 26, 2019)

    0.5.0 (2019-10-26)

    1. New Feature: Java 9, 10, 11, 12 support. But Java 6 and Java 7 are deprecated now.
    2. New Feature: Log handler
    3. New Feature: HTTP V2 support (thanks to Nginx v1.14.2)
    4. Bug Fix: Memory leak with file handler #180
    5. Bug Fix: Zero buffer error when hijack_send empty string #181
    6. Bug Fix: Mysql driver issue about jdbc4 flag
    7. Bug Fix: ContainsKey of nginx shared map
    8. Bug Fix: NginxRequest.setVariable in a rewrite handler will hang
    9. Bug Fix: Segmentation fault on shutdown
    10. Bug Fix: Make clojure request map immutable for compojure
    11. Enhancement: API for discarding request body (request.discardRequestBody())
    12. Enhancement: Coroutine support for cascade constructor invoking
    13. Enhancement: Configurable headers/variables prefetch for more safety in multithreaded mode
    14. Binaries Distribution: built with Nginx v1.14.2
    Source code(tar.gz)
    Source code(zip)
  • v0.4.5(May 28, 2017)

    0.4.5 (2017-05-28)

    1. New Feature: Support to be compiled as Nginx dynamic module, thanks to Andrew Hutchings
    2. Bug Fix: Cannot add multiple Cookies in a response
    3. Bug Fix: Too many empty chunks are passed to Body filter & some body data lost
    4. Enhancement: [Nginx-Jersey] Support jersey application sub class
    5. Enhancement: Try to use enviroment variable JAVA_HOME to detect jvm when jvm_path is auto
    6. Enhancement: NginxSharedHashMap.keySet/values/entrySet for debug/test usage.
    7. Bug Fix: Can not use more than two shared maps.
    8. Bug Fix: NullPointerExecption will happen when multiple rewrite handlers are invoked for one request
    9. Bug Fix: Can't access ring request data in Sente handler. (content_handler_property fore-prefetch-all-properties true;)
    10. Enhancement: Compile against Nginx 1.11 & Nginx 1.12
    11. Bug Fix: Nginx reload will cause connection reset without response
    12. Bug Fix: Header filter can not change response status from upstream
    13. Bug Fix: body filters sometimes crash under thread pool mode
    14. Binaries Distribution: built with the latest stable Nginx v1.12.0 & openssl v1.1.0e
    Source code(tar.gz)
    Source code(zip)
  • v0.4.4(Mar 4, 2016)

    0.4.4 (2016-03-04)

    1. New Feature: experimental nginx body filter by Java/Clojure/Groovy (issue #107)
    2. New Feature: read request body by event callback (issue #109)
    3. Bug Fix: 500 (internal server error) returns when committing 2000+ files to nginx as a proxy for apache mod_dav_svn (issue #106)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.3(Oct 25, 2015)

    0.4.3 (2015-10-25)

    1. New Feature: Add directive jvm_classpath which supports wildcard character * (issue #95)
    2. New Feature: Add directive jvm_classpath_check which is enabled by default and when it is enabled access permission about classpaths will be checked.
    3. New Feature: Add NginxPubSubTopic(Java)/PubSubTopic(Clojure) to simplify handling messages among Nginx worker processes. (issue #97)
    4. New Feature: Shared Map based on shared memory (issue #96) and it has two implementations : tinymap & hashmap.
    5. New Feature: Shared Map based Ring session store (issue #98)
    6. Enhancement: on-broadcast-event-decode!/on-broadcast! returns a removal function which can be used to remove the registered decoder/listener
    7. Enhancement: embedded nginx-clojure becomes friendly to mock tests and also fix issue #101
    8. Bug Fix: After stopping an embedded Nginx-Clojure server keep-alived connections become CLOSE_WAIT.
    9. Bug Fix: HackUtil.decode decodes unnecessary chars when several strings share one char[] generally on JDK 6
    10. Bug Fix: jvm crashes with thread pool mode when open_file_cache is enabled.
    11. Bug Fix: Fix compile errors when no sha1-implementation/zlib can be found (issue #99)
    12. Example Project: Add an example project about clojure web dev to show how to develop & deploy with Nginx-Clojure. Thanks to Peter Taoussanis without whose comments there would not be such example project. (issue #91)
    13. Documents: Add Directives Reference
    Source code(tar.gz)
    Source code(zip)
  • v0.4.2(Sep 1, 2015)

    0.4.2 (2015-08-31)

    1. New Feature: Support Sente (issue #87, see this PR)
    2. New Feature: Per-message Compression Extensions (PMCEs) for WebSocket (issue #88)
    3. New Feature: Add add-aggregated-listener! to makes handling small but fragmented websocket messages easier by clojure.
    4. Enhancement: Support to build on a Linux ARM machine
    5. Bug Fix: WebSocket and Server Channel do not Work with Some Ring Middlewares (issue #89)
    6. Bug Fix: Autodetect jvm_path doesn't work sometimes
    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Aug 12, 2015)

    0.4.1 (2015-08-12)

    1. New Feature: Coroutine based socket supports unix domain socket
    2. New Feature: APIs for Embedding Nginx-Clojure into a standard Clojure/Java/Groovy App (issue #86)
    3. New Feature: Autodetect jvm_path (issue #85)
    4. New Feature: Support to use annotation to mark a class or method to be suspenable in coroutine context (issue #84)
    5. Enhancement: Auto send error when meets a non websocket request with auto_upgrade_ws is on
    6. Enhancement: Add websocket-upgrade! to server channel API
    7. Enhancement: Add WholeMessageAdapter to make handling small websocket messages easier.
    8. Bug Fix: NginxHttpServerChannel.write(ByteBuffer buf) does not reset the buffer's position (issue #83)
    9. Bug Fix: No access to tomcat server 8.24 from nginx-clojure (issue #82)
    10. Binaries Distribution: Including some java sources for easy debug.
    11. Build Script: Autodetect JNI header files
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jul 5, 2015)

    0.4.0 (2015-07-06)

    1. New Feature: Service Side Websocket (issue #73)
    2. New Feature: A build-in Jersey container to support java standard RESTful web services (JAX-RS 2.0) (issue #74)
    3. New Feature: Tomcat 8 embedding support (so servlet 3.1/jsp/sendfile/JSR-356 websocket work within nginx!) (issue #67)
    4. New Feature: Coroutined Based Client Socket Supports to Bind to Specified IP Address (issue #69)
    5. New Feature: Handler's Property Configuration (issue #66)
    6. Enhancement: NginxHttpServerChannel can work with Rewrite Handler or Access Handler (issue #79)
    7. Enhancement: Configurable Write Buffer Size for SSE or Websocket (issue #76)
    8. Bug Fix: When we do not configure jvm_path proxy_pass will not work (issue #72)
    9. Bug Fix: nginx worker restart when get the value of header X-Forwarded-For (issue #70)
    10. Bug Fix: proxy_cache_path causes crash (issue #64)
    11. Bug Fix: send_timeout does not take effect with NginxHttpServerChannel (issue #78)
    12. Bug Fix: Waving tool generates wrong wave information of fuzzing classes (issue #80)
    13. Documents : Release History link in README (issue #68)
    14. Binaries Distribution: built with The latest stable Nginx v1.8.0 which released at 2015-04-21.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Dec 11, 2014)

    0.3.0 (2014-12-11)

    1. Discard: Directive clojure, clojure_code are no longer supported, use handler_type/content_handler_type, handler_name/content_handler_name, handler_code/content_handler_code instead.
    2. Discard: Now handler_*** can not be used to declare a nginx worker initialization handler, use `jvm_init_handler_*** instead.
    3. New Feature: Supports writing nginx access handler by java/clojure/groovy (issue #53)
    4. New Feature: Supports writing nginx header filter by java/clojure/groovy (issue #55)
    5. New Feature: Add new directive max_balanced_tcp_connections to make nginx auto set worker_connections.
    6. Enhancement: For Java We can use r.setVariable, r.getVariable now if r is an instance of NginxJavaRequest.
    7. Deprecated Directives: handler_type, handler_name, handler_code are deprecated and maybe will be removed in the next version, add new directive content_handler_type, content_handler_code, content_handler_code
    8. New Directives: rewrite_handler_type, access_handler_type, header_filter_type, body_filter_type
    9. New Feature: Supports nested locations (issue #56)
    10. Bug Fix : uppercase letters in nginx variable name can not work (issue #54)
    11. Bug Fix: The first registered handler will not work if there 's a asynchronous reading of request body (issue #51)
    12. Enhancement: handlers_lazy_init can be used to make handler initialized lazily or eagerly (issue #52)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.7(Nov 11, 2014)

    0.2.7 (2014-11-11)

    1. New Feature: Compiling option for disabling all functions silently when JVM_PATH not configured. (issue #47)
    2. New Feature: Access request BODY in rewrite handler (issue #49)
    3. Enhancement : Optimization of encoding String to Nginx temp buffer chain to reduce Java heap memory usage and improve the performance.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.6(Oct 10, 2014)

    0.2.6 (2014-10-10)

    1. Fix Bug: rewrite handler does not handle write event correctly with thread pool mode or coroutine mode (issue #43)
    2. Fix Bug: built-in jvm variable #{pno} doesn't work (issue #44)
    3. Fix Bug: rewrite_handler_name does not work without content handler (issue #45). Thanks Eric Kubacki for finding this bug.
    4. Fix Bug: rewrite handler does not handle write event correctly with thread pool mode or coroutine mode (issue #43)
    5. Documents : Correct some inaccuracies and add section about logging in Chapter More about Nginx-Clojure
    6. Binaries: built with the lastest stable Nginx v1.6.2 which released at 2014-09-16.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.5(Sep 7, 2014)

    0.2.5 (2014-09-07)

    1. New Feature: Reference variables in jvm_options & different jvm debug ports for jvm processes (issue #42)
    2. New Feature: Server Sent Events(SSE) & Long polling (issue #41, issue #36)
    3. New Feature: Supports 64-bit JDK on 64-bit Windows (issue #40)
    4. New Feature: Coroutine based socket supports JDK8 (issue #39)
    5. New Feature: More easier to archive Sub/Pub services with Broadcast Events to all Nginx workers (issue #39)
    6. New Feature: Asynchronous Channel a wrapper of asynchronous socket to make the usage easier (issue #37)
    7. Enhancement: Fix--On Windows a little many write events happen and these events seem useless (issue #35)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.4(Jul 26, 2014)

    0.2.4 (2014-07-25)

    1. New Feature: Support Groovy - another dynamic jvm language (issue #34)
    2. Fix bug: Slow Memory Leak for Coroutine based Socket bug (issue #32 )
    3. Fix bug: Should Clone ThreadLocals for Coroutines (issue #31)
    4. New Feature: More friendly to java users who maybe know nothing about clojure feature (issue #29)
    5. Five new nginx directives handler_type, handler_name, handler_code, rewrite_handler_name, rewrite_handler_code. Make Clojure/Java/Groovy handler configurations have the same form. e.g. The old pair of nginx directives clojure, clojure_code is equivalent to handler_type='clojure' + handler_code.

    The binary release (support win32, linux x86 32bit, linux x64, macosx) can be found from https://sourceforge.net/projects/nginx-clojure/files/

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(Jul 5, 2014)

    0.2.3 (2014-07-05)

    1. Fix issue After invoking on coroutine based socket nginx worker will exit and be recreated when network is disabled (issue #26)
    2. Fix issue PATCH loses the data payload (issue #27)
    3. Support user defined http request method (issue #28 )
    4. Fix issue Nginx worker crashes when to fetch http header "authorization" from request (issue #30)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(May 31, 2014)

    0.2.2 (2014-05-31)

    1. Fix bug of with Compojure 1.1.5 + Apache Solrj 4.3.0 + httpclient 4.3.2 NPE happens first time then everything is OK (issue #22)
    2. Verifying option for auto generated waving configurations needed by coroutine based socket (issue #23)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(May 17, 2014)

    0.2.1 (2014-05-17)

    1. Support to close coroutine based socket from non-main thread (issue #19)
    2. Auto generated waving class configurations about Proxy InvocationHandler instance (issue #17 )
    3. Supports auto turn on thread pool mode when turning on Run Tool Mode feature (issue #16 )
    4. Fix bug of reading from coroutine based socket inputstream returns 0 when eof, should return -1 (issue #15)
    5. Handle multiple sockets parallel in sub coroutines, e.g. we can invoke two remote services at the same time feature (issue #14)
    6. Support nginx rewrite handler to set var before proxy pass (issue #3)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Apr 26, 2014)

    0.2.0 (2014-04-25)

    1. non-blocking socket based on coroutine and compatible with largely existing java library such as apache http client, mysql jdbc drivers
    2. asynchronous callback API of socket for some advanced usage
    3. run initialization clojure code when nginx worker starting
    4. provide a build-in tool to make setting of coroutine based socket easier
    5. support Linux 32bit x86 now
    6. publish binary release compiled with lastes stable nginx 1.6.0 about Linux x64, Linux i586, Win32 & MacOS X
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Feb 2, 2014)

  • v0.1.1(Jan 20, 2014)

    1. Supports InputStream, ISeq & recursive ISeq in Response Body.
    2. Auto maintains HTTP last-modified header for multiple files in Response Body
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jan 9, 2014)

Owner
nginx-clojure
Provide Nginx module for embedding Clojure or Java programs.
nginx-clojure
Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.

Payara Platform Community Edition Create. Innovate. Elevate. Payara Platform Community Edition features open source server runtimes for development pr

Payara Foundation 847 Dec 27, 2022
Clojure's data structures modified for use outside of Clojure

This library has been extracted from the master branch of Clojure (http://clojure.org) version 1.5.1 (as of October 2013) http://github.com/richhick

Karl Krukow 221 Oct 6, 2022
Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners.

Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners. If You Have any doubt or query you can ask me here or you can also ask me on My LinkedIn Profile

Shaikh Minhaj 3 Nov 8, 2022
This repository contains Java programs to become zero to hero in Java. Programs related to each and every concep are present from easy to intermidiate level.

Learn Java Programming In this repository you will find topic wise programs of java from basics to intermediate. This follows topic wise approach that

Sahil Batra 15 Oct 9, 2022
a reverse proxy load balancer using Java. Inspired by Nginx.

Project Outline: Project Main coding reverse proxy support configuration adding unit test works on Websocket Stress Test compared to Nginx load balanc

Feng 12 Aug 5, 2022
Composable event handlers and skin scaffolding for JavaFX controls.

This project is no longer being maintained. See this issue for more details. WellBehavedFX This project provides a better mechanism for defining and o

null 52 Oct 9, 2022
Dex : The Data Explorer -- A data visualization tool written in Java/Groovy/JavaFX capable of powerful ETL and publishing web visualizations.

Dex Dex : The data explorer is a powerful tool for data science. It is written in Groovy and Java on top of JavaFX and offers the ability to: Read in

Patrick Martin 1.3k Jan 8, 2023
Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc

jsonschema2pojo jsonschema2pojo generates Java types from JSON Schema (or example JSON) and can annotate those types for data-binding with Jackson 2.x

Joe Littlejohn 5.9k Jan 5, 2023
Provides additional date-time classes that complement those in JDK 8

ThreeTen-Extra ThreeTen-Extra provides additional date-time classes that complement those in JDK 8. Not every piece of date/time logic is destined for

ThreeTen 361 Jan 8, 2023
http-kit is a minimalist, event-driven, high-performance Clojure HTTP server/client library with WebSocket and asynchronous support

HTTP Kit A simple, high-performance event-driven HTTP client+server for Clojure CHANGELOG | API | current Break Version: [http-kit "2.5.3"] ; Publish

HTTP Client/Server for Clojure 2.3k Dec 31, 2022
Clojure bindings for the Chromium Embedded Framework

clj-cef Clojure bindings for the Chromium Embedded Framework Dependency: Rationale From https://bitbucket.org/chromiumembedded/cef/src/master/ Some us

Adrian 45 Nov 2, 2022
A Camunda Process Engine Plugin to execute Clojure Functions from Activities

camunda-clojure-plugin A Camunda Process Engine Plugin to execute Clojure Functions as Delegates Why do we need this? While Camunda is tightly integra

lambdaschmiede GmbH 11 Oct 11, 2022
A small tools to play with JavaFX Color.derive() function - allows to create custom colors and to save those in color palettes.

DeriveColorsFX This is not a serious application. Its a small tool where I just played with the method Color::deriveColor provided by JavaFX. Also its

Oliver Löffler 11 Oct 9, 2022
Calcite Clojure wrapper / integration

calcite-clj - Use Apache Calcite from Clojure Small library to facilitate the implementation of calcite adapters in clojure. It implements org.apache.

Eugen Stan 24 Nov 5, 2022
WordleCompanion - A tool to help you determine those hard-to-guess words while doing your daily Wordle puzzles.

A tool to help you determine those hard-to-guess words while doing your daily Wordle puzzles. How it works Enter the 5-letter word you

Ken Vaczi 1 Jan 22, 2022
Core for open source libraries, included some important Classes for those libs.

OpenSource Core You could also read the CHINESE version of README This is a very useful Java class library. In this update, we have merged the origina

Theodore Hills 10 Nov 16, 2022
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

RxJava: Reactive Extensions for the JVM RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-base

ReactiveX 46.7k Dec 30, 2022
Short Java programs for practice (OCP) Oracle Certified Professional Java SE 11

OCP-study Short Java programs to practice for (OCP) Oracle Certified Professional Java SE 11 Exam Google document with notes: https://docs.google.com/

Sabina Matjašič 1 May 24, 2022
This repository contains Java programs to become zero to hero in Java.

This repository contains Java programs to become zero to hero in Java. Data Structure programs topic wise are also present to learn data structure problem solving in Java. Programs related to each and every concep are present from easy to intermidiate level

Sahil Batra 15 Oct 9, 2022