Back to rankings

zfoo-project/zfoo

Java

💡Extremely fast enterprise server framework, can be used in RPC, game server, web server.

nettyserializationgame-serverspringnetworkwebsocketrpcormhotswapmongodbgame-frameworkjavassist
Star Growth
Stars
2k
Forks
415
Weekly Growth
Issues
19
5001k1.5k2k
May 2021Jan 2023Oct 2024Jul 2026
ArtifactsMavengit clone https://github.com/zfoo-project/zfoo.git
README

English | 简体中文

Ⅰ. Introduction of zfoo🚩

  • Extremely fast, asynchronous, actor design, lock free, universal RPC framework, native GraalVM support
  • High scalability, Single server deployment, microservice deployment, cluster deployment, gateway deployment
  • Can be used as a game server framework or website server framework
  • zfoo protocol supports C++ Rust Java/Kotlin/Scala JavaScript/TypeScript/ES C# Go Php Ruby Lua GDScript Python Dart Swift

Perfect work development process, complete online solution

  • Spring projects, distributed projects, container projects, hot update code without downtime hotswap
  • Excel json csv configuration is automatically mapped and parsed, Online hotswap configuration storage
  • Automapping framework for MongoDB orm
  • Event bus event
  • Time task scheduling scheduler
  • Cpu, memory, hard disk, network monitoring built into the program no code and extra tools required monitor

Ⅱ. Who uses this project

  • Projects with extremely high-performance requirements, such as website and game server frameworks, single server, global server, live chat, IM system, real-time push
  • Projects such as saving, development, deployment, operation and maintenance costs
  • As a backend infrastructure for Godot, Unity, Cocos,Webgl, H5, Network protocol supports tcp udp websocket http
  • Keep it Simple and Stupid, simple configuration, lightweight code

Ⅲ. Maven dependency✨

  • Environment requirement JDK 17+, support OpenJDK, Oracle JDK and native GraalVM
<dependency>
    <groupId>com.zfoo</groupId>
    <artifactId>boot</artifactId>
    <version>4.1.4</version>
</dependency>
  • If you don't want to depend on all zfoo modules, you only need to choose to depend on one of them
<dependency>
    <groupId>com.zfoo</groupId>
    <artifactId>protocol</artifactId>
    <version>4.1.4</version>
</dependency>

Ⅳ. Tutorials

Ⅴ. Usage⭐

1. protocol ultimate performance serialization and deserialization

// protocol registration
ProtocolManager.initProtocol(Set.of(ComplexObject.class, ObjectA.class, ObjectB.class));

// serialization
ProtocolManager.write(byteBuf, complexObject);

// deserialization
var packet = ProtocolManager.read(byteBuf);

2. net ultimate performance RPC framework, supports tcp udp websocket http

// Service provider, only need to add an annotation to the method, the interface will be automatically registered
@PacketReceiver
public void atUserInfoAsk(Session session, UserInfoAsk ask) {
}

// Consumers, synchronously requesting remote service, will block the current thread
var ask = UserInfoAsk.valueOf(userId);
var answer = NetContext.getCosumer().syncAsk(ask, UserInfoAnswer.class, userId).packet();

// Consumers, asynchronously requesting remote service, and will still execute logic in the current thread after the asynchronous
NetContext.getCosumer().asyncAsk(ask, UserInfoAnswer.class, userId)
          .whenComplete(answer -> {
              // do something
          );

3. hotswap hot update code, no need to stop the server, no additional configuration, just one line of code to start hot update

// Pass in the class file that needs to be updated
HotSwapUtils.hotswapClass(bytes);

4. orm automatic mapping framework based on mongodb

// You don't need to write sql and any configuration yourself, define a table in the database directly through annotation definitions
@EntityCache
public class UserEntity implements IEntity<Long> {
    @Id
    private long id;
    private String name;
}

// update database data
entityCaches.update(userEntity);

5. event use the observer design pattern, decouples different modules and improves the quality of the code

// To receive an event, you only need to add an annotation to the method and the method will be automatically listen for the event
@EventReceiver
public void onMyNoticeEvent(MyNoticeEvent event) {
    // do something
}

// fire an event
EventBus.post(MyNoticeEvent.valueOf("My event"));

6. scheduler scheduling Framework Based on Cron Expression

@Scheduler(cron = "0/1 * * * * ?")
public void cronSchedulerPerSecond() {
    // do something
}

7. storage Excel to class automatic mapping framework, you only need to define a class corresponding to Excel, and directly parse Excel

@Storage
public class StudentResource {
    @Id
    private int id;
    @Index
    private String name;
    private int age;
}

Ⅵ. Commit specification👏

  • People who like this project are welcome to maintain this project together, and pay attention to the following specifications when submitting code
  • The code formats use the default formatting of IntelliJ Idea
  • conventional-changelog-metahub

Ⅶ. License

zfoo use Apache License Version 2.0

JetBrains Logo (Main) logo

Related repositories
crossoverJie/JCSprout

👨‍🎓 Java Core Sprout : basic, concurrent, algorithm

JavaMavenMIT Licensejavaconcurrent-programming
crossoverjie.top/JCSprout
26.9k7k
doocs/source-code-hunter

😱 从源码层面,剖析挖掘互联网行业主流技术的底层实现原理,为广大开发者 “提升技术深度” 提供便利。目前开放 Spring 全家桶,Mybatis、Netty、Dubbo 框架,及 Redis、Tomcat 中间件等

JavaMavenCreative Commons Attribution Share Alike 4.0 Internationalsourcecode-analysisspring
schunter.doocs.org
23.1k4.2k
eclipse-vertx/vert.x

Vert.x is a tool-kit for building reactive applications on the JVM

JavaMavenOthervertxjava
vertx.io
14.7k2.1k
crossoverJie/cim

📲cim(cross IM) 适用于开发者的分布式即时通讯系统

JavaMavenMIT Licensenettytcp
crossoverjie.top/categories/Netty/
9.5k2.9k
mrniko/netty-socketio

Socket.IO server implemented on Java. Realtime java framework

JavaMavenApache License 2.0socket-iojava
7k1.7k
gatling/gatling

Modern Load Testing as Code

ScalaApache License 2.0nettyscala
gatling.io
6.9k1.2k
jetlinks/jetlinks-community

JetLinks 基于Java,Spring Boot ,WebFlux,Netty,Vert.x,Reactor等开发, 是一个全响应式的企业级物联网平台。支持统一物模型管理,多种设备,多种厂家,统一管理。统一设备连接管理,多协议适配(TCP,MQTT,UDP,CoAP,HTTP等),屏蔽网络编程复杂性,灵活接入不同厂家不同协议等设备。实时数据处理,设备告警,消息通知,数据转发。地理位置,数据可视化等。能帮助你快速建立物联网相关业务系统。

JavaMavenApache License 2.0iotjava
jetlinks.cn
6.5k1.9k
AsyncHttpClient/async-http-client

Asynchronous, non-blocking HTTP & WebSocket client for the JVM

JavaMavenApache License 2.0nettyasync
6.4k1.6k
JackJiang2011/MobileIMSDK

原创全平台IM通信层框架,轻量级、高度提炼,历经10年、久经考验。可能是市面上唯一同时支持UDP+TCP+WebSocket三种协议的同类开源框架,支持 iOS、Android、Java、H5、小程序、Uniapp、鸿蒙Next,服务端基于Netty。

Objective-CApache License 2.0imudp
52im.net/forum-89-1.html
6.1k1.4k
line/armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.

JavaMavenApache License 2.0httphttp2
armeria.dev
5.1k1k
helidon-io/helidon

Java libraries for writing microservices

JavaMavenApache License 2.0javamicroservice-framework
helidon.io
3.8k605
mpusher/mpush

MPush开源实时消息推送系统

JavaMavenApache License 2.0pushnetty
mpusher.github.io
3.8k1.4k