Clivia is a scalable, high-performance, elastic and responsive API gateway based on spring weblux

Overview

image

clivia是一款基于spring webflux的可扩展、高性能、高弹性、响应式的 API 网关

clivia_V0.0.1

License Travis


架构概览

image

模块介绍

  • clivia-admin-core : 网关配置管理后台核心模块

  • clivia-client-core : 网关核心模块

  • clivia-example : 开箱即用的实例

  • clivia-event : 系统事件入口模块

  • clivia-api : 基础api信息模块

  • clivia-cache : 系统缓存模块

  • clivia-dynamic : 基于groovy的动态代码文件加载模块

  • clivia-filter : 可扩展的系统过滤器集合模块

  • clivia-invoke : 可扩展的系统执行器集合模块

  • clivia-loadbalance : 内置可扩展的负载均衡策略模块

  • clivia-assembly-base : 系统中间件模块(redis、metrics)

  • clivia-spi : 系统spi模块

  • clivia-support : 系统公共支撑模块


特点

  • 支持多种API配置方式,例如数据库、文件、可视化界面方式(规划中)配置API信息;支持系统/接口级别的服务接入
  • 系统具备安全验证、黑名单、验签、限流、url重写、熔断、mock、header、系统开关等常用过滤器;具备http、dubbo、spring cloud、websocket等类型rpc转发功能
  • 系统具备高弹性,在不停机的情况下支持基于groovy的代码文件加载
  • 模块划分清晰;扩展性强,具有完善的扩展机制
  • 支持高可用集群及灰度发布

系统介绍

1、API信息的配置

  • 数据库配置方式请参考/script/apiCconfig.docx
  • 文件配置方式请参考/script/fileConfig/fileConfig.md
  • web配置方式(规划中)

2、缓存&数据同步

  • spring 框架启动后会进行clivia-event模块调用,clivia-event会加载clivia-cache模块DefaultCliviaCacheManager类中的initCache方法,完成全量API配置/黑名单/filter/invoker的加载,并放入CliviaCacheFactory进行缓存。在首次加载完成后,系统会定时进行缓存增量更新
  • CliviaCacheFactory目前有三种缓存实现,分别为CliviaStandandCacheFactory(直接将数据更新到内存),CliviaLocalCacheFactory(分离式内存缓存更新) ,CliviaRemoteCacheFactory(分离式远程缓存,待完善)
  • API配置/黑名单配置的数据同步机制:clivia-cache模块通过http请求clivia-admin模块,clivia-admin 优先从本地缓存获取数据并响应该请求。

3、弹性

  • 在网关运行期间,可在不停机的情况下将测试完成的groovy动态代码文件放置在扫描目录下,系统将自动定时扫描该目录下的文件,并进行编译和加载
  • 目前支持filter和invoker的弹性加载,如有定制化需要,可参考clivia-dynamic

4、过滤器

  • 目前内置了多种网关过滤器,包括安全验证、黑名单、验签、限流、重写、熔断、header、mock、系统开关等,后续将持续添加更多过滤器
  • 定制化的方式:1、新增自定义过滤器模块,实现CliviaFilter接口并重新进行编译;2、通过加载动态文件的方式完成扩展定制。

5、执行器

  • 执行器提供不同Rpc下游服务转发,目前支持dubbo、http、spring cloud、websocket,后续可以添加更多执行器
  • 定制化的方式同过滤器

6、安全设计

  • 网关与配置管理端均使用token的方式进行单向交互
  • 网关提供请求的appKey校验以及请求数据验签

Getting started

If you want to try out the cutting-edge features, you can build with the following commands. (Java 1.8 is needed to build the master branch)
* clone project
  • Building

    # mvn clean install
    
  • 准备网关元数据(文件配置方式、数据库配置方式)

  • run(先后启动clivia-example下的admin和client子工程)

    #  java -jar clivia-gateway-admin-0.0.1.jar
    #  java -jar clivia-gateway-client-0.0.1.jar
    

交流

欢迎您加入到clivia交流群。 QQ群 1:574835875

协议


关于

  • 2021年3月后,作者个人利用零散的节假日时间完成了项目设计以及各模块的开发,劳烦大家star,让更多人关注到clivia。 作者最大的愿望是该项目能够让使用者受益,同时也希望开源社区爱好者能够一起完善该项目,争取早日能够将项目推进到release阶段。

You might also like...

High performance RPC framework based on netty

RPC(Remote Procedure Call)实战 @desc: 仅用于个人学习、了解RPC @date: 2021/01/16 技术组成: 版本一 版本二 版本三 传输层 Netty4 * * 编码层 Kryo * * 应用层 JDK动态代理 * * 服务注册与发现 手动注册+guava缓存

Nov 22, 2022

✈A high-performance RPC based on Java & Netty.

bRPC README 中文版本 一个基于netty的RPC框架 基于netty NIO、IO多路复用。 client与server端建立心跳包保活机制。发生未知断连时,重连保证可靠长连接。 使用kryo序列化,自定义传输包,及传输格式,避免TCP沾包问题。 支持zookeeper或nacos做服务

Dec 16, 2022

ActiveJ is an alternative Java platform built from the ground up. ActiveJ redefines web, high load, and cloud programming in Java, featuring ultimate performance and scalability!

Introduction ActiveJ is a full-featured modern Java platform, created from the ground up as an alternative to Spring/Micronauts/Netty/Jetty. It is des

Jan 7, 2023

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

Jan 5, 2023

High Performance data structures and utility methods for Java

High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Jan 7, 2023

The High-Performance Java Persistence book and video course code examples

The High-Performance Java Persistence book and video course code examples

High-Performance Java Persistence The High-Performance Java Persistence book and video course code examples. I wrote this article about this repositor

Jan 9, 2023

Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

Dec 20, 2022

Universal, flexible, high-performance distributed ID generator

Universal, flexible, high-performance distributed ID generator

CosId Universal, flexible, high-performance distributed ID generator 中文文档 Introduction CosId aims to provide a universal, flexible and high-performanc

Dec 27, 2022

Asynchronous, high-performance Minecraft Hologram library for 1.8-1.18 servers.

Asynchronous, high-performance Minecraft Hologram library for 1.8-1.18 servers.

Hologram-Lib Asynchronous, high-performance Minecraft Hologram library for 1.8-1.18 servers. Requirements This library can only be used on spigot serv

Dec 20, 2022
Owner
palading
palading
A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway, resillience4j, Kafka, Redis and MySQL.

High-availability-shopping-system A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway,

LeiH 1 Oct 26, 2022
Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

spring-microservice Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker. Arc

null 4 Sep 13, 2022
Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit Breaker + Resilience4J + FeignClient + RestTemplate

Spring boot microservice example Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit B

Subhash Lamba 47 Dec 29, 2022
Sample Spring-Cloud-Api-Gateway Project of Spring Boot

Sample-Spring-Cloud-Api-Gateway Sample Spring-Cloud-Api-Gateway Project of Spring Boot Proejct Stack Spring Webflux Spring Cloud Gateway Spring Data R

Seokhyun 2 Jan 17, 2022
Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence This repo contains the source code of the Cadence server and other tooling including CLI, schema tools, bench and canary. You can implement yo

Uber Open Source 6.5k Jan 4, 2023
Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

Spring-Cloud-MSA 준비 Cassandra 서버를 준비한다 table.sql 파일로 keyspace와 테이블을 만들어 둔다 Consul 1.11.1버전 기준 https://www.consul.io/downloads 에서 1.11.1 버전 운영체제 맞게 다운

INSUNG CHOI 2 Nov 22, 2022
Spring-Boot-Plus is a easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding

Everyone can develop projects independently, quickly and efficiently! What is spring-boot-plus? A easy-to-use, high-speed, high-efficient, feature-ric

geekidea 2.3k Dec 31, 2022
source code of the live coding demo for "Building resilient and scalable API backends with Apache Pulsar and Spring Reactive" talk held at ApacheCon@Home 2021

reactive-iot-backend The is the source code of the live coding demo for "Building resilient and scalable API backends with Apache Pulsar and Spring Re

Lari Hotari 4 Jan 13, 2022
A dubbo gateway based Java language.

A dubbo gateway based Java language.

老夫正年轻 19 Sep 24, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023