ESA Restlight

ESA Restlight is a lightweight and rest-oriented web framework, which supports annotations of SpringMVC and JAX-RS.

Why Restlight?

In microservices, it is generally expected that service is a lightweight application, and the Spring-Web framework we often use is really a good framework that allows us to develop a variety of applications easily, but it is too bloated for applications in microservices, which just need a rest supports and do not need the session, ModelAndview, JSP and so on… Restlight aims to serve as a web framework that helps users to build a high performance and lightweight microservice.

What kind of web application is Restlight suitable for?

  • Rest application
  • High-performance requirements
  • Middleware
  • HTTP proxy
  • Any application that needs HTTP services

What kind of web application is Restlight not suitable for?

  • All in one application
  • Servlet requirements: Restlight does not support servlet standards

Env Requirements

Name Version
Java JDK8+
Spring Boot 2.1.0.RELEASE+
Netty 4.1.52.Final+
Tcnative 2.0.34.Final+ and matches with Netty

Features

  • Annotations of SpringMVC and JAX-RS supports
  • High performance
  • Reactive:CompletableFutureListenableFuture(Guava).
  • Threading-model: Flexible scheduling between IO EventLoopGroup and Biz Schedulers.
  • Http1/Http2/H2c/Https
  • HAProxy
  • Filter
  • Interceptor
  • JSR-303: hibernate-validator
  • Self-protection: Connection creation limit, Cpu Load protection
  • more …

Release Notes

Releases


Getting Started

It’s very easy to get started with Restlight!

Architecture

线程模型

Restlight Starter

Restlight StarterRestlight Spring 基础上封装的Spring Boot Starter提供基于Spring Boot的自动配置

扩展能力

Restlight内置了常用的Filter(IP白名单、新建连接数限制、CPU过载保护)、Interceptor(访问日志、参数签名验证)和表单参数解析器

Spring Boot Actuator支持

Restlight适配了Spring Boot Actuator, 提供详细的健康检查以及监控等接口

Spring MVC 支持

Restlight支持了Spring MVC的使用习惯,你可以按照Spring MVC的方式使用Restlight

JAX-RS 支持

Restlight支持了JAX-RS的使用习惯,你可以按照JAX-RS的方式使用Restlight

Restlight Server

Restlight Core

esa.restlight.core.RestlightRestlight架构中的Restlight Core模块的入口类, 在Restlight Server 基础上丰富了更多的功能

Restlight for Spring

全链路异步

当前Restlight版本支持FilterHandlerInterceptor, Controller, ExceptionHandler异步。

使用注意