A fast, lightweight and cloud native microservices framework.
轻型,高性能, 结合云端的微服务开发平台。
Developer Chat | Documentation | Contribution Guide |
Light means lightweight, lighting fast and shed light on how to program with modern Java SE.
It is 44 times faster than the most popular microservices platform Spring Boot embedded Tomcat and use only 1/5 of memory. Here is the benchmark results compare with Spring Boot and other microservices frameworks. Here is the comparison with other Web frameworks.
目前大多数微服务开发都是基于Spring Boot框架的开发。 但 Spring Boot依然是一个JEE Base 的开发框架,所以本身就带有了JEE 的瓶颈和缺陷。我们提供了一个轻型,高性能, 结合云端的微服务开发平台-Light-4j, 从一些机构的测试的数据看, 基于Light-4j框架的开发的微服务应用可以44倍快速于基于Spring Boot框架的开发的微服务应用(API), 所用内存是基于Spring Boot框架的开发的微服务应用的1/5。
和其他平台比较结果
现有微服务开发平台评级结果; Light-4j 的restful 框架(light-rest-4j)评级5星。
微服务平台 with Red Hat 3scale;
Design OpenAPI specification and generate the service from it. The specification is also part of the framework to drive security verification and request validation at runtime.
Unit/End-to-End test stubs are generated to enable test driven approach for quality product.
Debugging within IDE just like standalone application for better developer productivity.
Dockerfile and DevOps supporting files are generated to support dockerization and continuous integration to production.
light-rest-4j is a RESTful microservice framework with OpenAPI specification for code generation and runtime security and validation light-graphql-4j is a GraphQL microservice framework that supports schema generation from IDL and plugin. light-hybrid-4j is a hybrid microservice framework that takes advantages of both monolithic and microservice architectures. light-eventuate is a messaging based microservice framework based on Kafka, event sourcing and CQRS
All the open sourced frameworks are built in Java and we are working on Nodejs framework internally. In the future, we might provide Golang framework as well and all them are sharing the same eco-system and market place.
OAuth2 Server for security and Portal for production monitor and management. The portal is also a marketplace to link clients and services together.
There are two ways to start your project:
You can use light-codegen to generate a working project. Currently, it supports light-rest-4j, light-graphql-4j, light-hybrid-server-4j and light-hybrid-service-4j. light-eventuate code generator is coming.
The light-codegen project README.md describes four ways to use the generator with examples.
The other way to start your project is to copy from light-example-4j.
You can find the description of these examples
Also, there are some tutorials
To run/debug from IDE, you need to configure a Java application with main class "com.networknt.server.Server" and working directory is your project folder. There is no container and you are working on just a standalone Java application.
create a Java application that main class is com.networknt.server.Server and working directory is your project root folder. You can debug your server just like a POJO application.
mvn exec:exec
java -jar target/demo-0.1.0.jar
you can use Ctrl+C to kill the server but for production use the following command
kill -s TERM <pid>
The server has a shutdown hook and the above command allow it to clean up. For example, complete in-flight requests and close the database connections etc. If service registry and discovery is used, then the server will send shutdown event to service registry and keep processing requests for 30 seconds until all clients refreshes their local cache before shutting down.
Light-4j and all light-*-4j frameworks are available under the Apache 2.0 license. See the LICENSE file for more info.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。