多语言通用服务器 hi-nginx-1.1.0 发布,开始支持 Java - 开源中国社区
多语言通用服务器 hi-nginx-1.1.0 发布,开始支持 Java
所以呢 2017年08月29日

多语言通用服务器 hi-nginx-1.1.0 发布,开始支持 Java

所以呢 所以呢 发布于2017年08月29日 收藏 49

hi-nginx-1.1.0 发布了。

此次更新:

  • 支持java

hi-nginx是一款基于nginx写成的通用服务器。它既是web server,也是application server;它不仅继承了nginx的全部功能,完全兼容nginx,而且支持多种语言混合开发web应用。它性能强劲,易于开发,部署方便。

目前,hi-nginx支持混合使用c++,python,lua和JAVA同时进行web应用开发。用户应该根据应用场景的实际需要,细粒度地选择最为合适的开发语言,最大限度的发挥hi-nginx的潜能。

hi-nginx致力于增强用户的工作,而不是改变用户的工作。当用户不满意它时,用户可以安全地“回滚”至之前的工作状态,而不会产生任何损失。

Java 例子:

package hi;

public class jhello implements hi.servlet {

    public jhello() {

    }

    public void handler(hi.request req, hi.response res) {
        res.status = 200;
        res.content = "hello,world";

    }
}

Java 配置例子:

        hi_java_classpath "-Djava.class.path=.:/usr/local/nginx/java:/usr/local/nginx/java/hi-nginx-java.jar";
        hi_java_options "-server -d64 -Xms512m -Xmx512m -Xmn170m";
        hi_java_servlet_cache_expires 300s;
        hi_java_servlet_cache_size 10;
        hi_java_version 8;
        location = /jhello {
            hi_need_cache off;
            hi_java_servlet_cache_expires 60s;
            hi_java_servlet hi/jhello;
    }

主项目地址:https://github.com/webcpp/hi-nginx

文档地址:https://github.com/webcpp/hi-nginx-doc

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 开源中国社区 [http://www.oschina.net]
本文标题:多语言通用服务器 hi-nginx-1.1.0 发布,开始支持 Java
分享
评论(13)
精彩评论
1
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.
-----------------
对这个特性的支持非常重要。
1
顺道查了一下,nginx已经支持js
1
既然能支持 java 那么支持 .net 也快了吧?
最新评论
0
能实现多线程吗?
0
无敌了
0

引用来自“jamesZhou”的评论

顺道查了一下,nginx已经支持js
nginx支持JS是哪个项目?LUA真的用的不顺手
1
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.
-----------------
对这个特性的支持非常重要。
0
Handle multiple sockets parallel in sub coroutines, e.g. we can invoke two remote services at the same time.
Asynchronous callback API of socket/Channel for some advanced usage
Long Polling & Server Sent Events
Run initialization clojure code when nginx worker starting
Support user defined http request method
One of benifits of Nginx is worker processes are automatically restarted by a master process if they crash
Utilizes lazy headers and direct memory operation between Nginx and JVM to fast handle dynamic contents from Clojure or Java code.
Utilizes Nginx zero copy file sending mechanism to fast handle static contents controlled by Clojure or Java code..
0
Shared Map based on shared memory & Shared Map based Ring session store
Support Per-message Compression Extensions (PMCEs) for WebSocket
APIs for Embedding Nginx-Clojure into a Standard Clojure/Java/Groovy App
Server Side Websocket
A build-in Jersey container to support java standard RESTful web services (JAX-RS 2.0)
Tomcat 8 embedding support (so servlet 3.1/jsp/sendfile/JSR-356 websocket work within nginx!)
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
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.
0
https://github.com/nginx-clojure/nginx-clojure
支持Java功能,我觉得整合这个模块比较好吧。

功能特性:
Compatible with Ring and obviously supports those Ring based frameworks, such as Compojure etc.
Http Services by using Clojure / Java / Groovy to write simple handlers for http services.
Nginx Access Handler by Clojure / Java / Groovy
Nginx Header Filter by Clojure / Java / Groovy
NEW: Nginx Body Filter by Clojure / Java / Groovy
Pub/Sub Among Nginx Worker Processes
0
支持java的什么?
1
顺道查了一下,nginx已经支持js
0
这样的调用方式没有意义,浪费内存,项目更新和地址不方便维护,也没有脚本的优势,支持js实现lua的一些功能还好些,js轻量,动态,比较适合做逻辑处理。支持其他语言的最终目的是实现动态性,和处理定制化的逻辑
1
既然能支持 java 那么支持 .net 也快了吧?
0
PyPy有可能被支持吗
0
厉害了
顶部