# usher-protofuse **Repository Path**: opentech_usher/usher-protofuse ## Basic Information - **Project Name**: usher-protofuse - **Description**: Protofuse 是多协议统一处理开源框架,解决协议碎片化与迭代耦合问题。 接入层原生支持 MySQL、HTTP、Redis、MQTT 监听;解析层通过扩展接口转原始数据为统一结构;执行计划层按解析结果生成步骤逻辑。 核心框架不提供执行器,通过 Executor SPI 机制 开放接口,执行器由独立的 proto-executors-ext 扩展模块 实现,支持自定义开发。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-16 - **Last Updated**: 2026-02-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Usher-Protofuse
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) ![Java Version](https://img.shields.io/badge/Java-8%2B-blue) ![Maven](https://img.shields.io/badge/Maven-3.0%2B-blue) **多协议融合数据库中间件 | Distributed Database Middleware with Multi-Protocol Support**
## 🌟 项目简介 Usher-Protofuse 是一个先进的数据库中间件解决方案,支持多种数据库协议,提供分布式数据库能力。该项目旨在解决传统数据库在扩展性、协议兼容性和分布式处理方面的挑战。 核心特性: - 🔄 多协议支持(当前支持 MySQL 协议,后续会支持 http, dubbo等协议) - 📊 分布式查询执行计划 - ⚡ 高性能网络通信(基于 Netty) - 🔧 灵活的模块化架构 - 🛠️ Spring Boot 集成支持 ## 🏗️ 项目架构 ``` usher-protofuse ├── usher-protofuse-call-node # 执行节点模块 ├── usher-protofuse-common # 公共模块 ├── usher-protofuse-plan # SQL解析执行计划模块 ├── usher-protofuse-protocol # 协议实现模块 │ └── usher-protofuse-protocol-mysql # MySQL协议实现 └── usher-protofuse-spring # Spring集成模块 └── usher-protofuse-mysql-spring # MySQL协议Spring集成 ``` ## 🚀 快速开始 ### 环境要求 - Java 8 或更高版本 - Maven 3.0 或更高版本 ## 📖 使用示例 ### 引入 Starter 依赖 在您的 Spring Boot 项目中引入 `usher-protofuse-mysql-spring-boot-starter` 依赖: ```xml top.uhyils.usher usher-protofuse-mysql-spring-boot-starter 2.1.0.11.usher-SNAPSHOT ``` ### 实现自定义处理器 创建自定义 MySQL 协议处理器,继承 [AbstractMysqlProtofuseHandler.java](usher-protofuse-spring/usher-protofuse-mysql-spring-boot-starter/src/main/java/top/uhyils/usher/mysql/AbstractMysqlProtofuseHandler.java) 并将其注册为 Spring Bean: ```java @Component public class CustomMysqlProtofuseHandler extends AbstractMysqlProtofuseHandler { @Override protected NodeModuleInfo findByDatabaseAndTable(String database, String table) { // 实现根据数据库名和表名获取表信息的逻辑 return null; } @Override protected LoginUserDTO buildLoginUserAfterLoginSuccess(MysqlAuthCommand command, String ip, Object userContext) { // 实现登录成功后的用户信息构建逻辑 return null; } @Override protected LoginUserHandler findByUsername(String username) { // 实现根据用户名获取用户信息的逻辑 return null; } // 根据需要重写其他抽象方法... } ``` ### 配置应用属性 在 application.yml 中配置相关属性: ```yaml usher: protofuse: mysql-port: 3306 # 其他配置项... ``` ### 启动服务 ```bash # 启动 Spring Boot 应用 mvn spring-boot:run ``` ### 连接数据库 使用标准 MySQL 客户端连接 Usher-Protofuse: ```bash mysql -h localhost -P 3306 -u your_user -p ``` ### 查询数据 ```sql SELECT * FROM your_table WHERE condition = 'value'; ``` 这种方式利用了 Spring Boot 的自动配置机制,只需要简单地引入 starter 依赖并实现 [AbstractMysqlProtofuseHandler](usher-protofuse-spring/usher-protofuse-mysql-spring-boot-starter/src/main/java/top/uhyils/usher/mysql/AbstractMysqlProtofuseHandler.java) 抽象类,就可以快速搭建起一个支持 MySQL 协议的数据库中间件服务。 ## 📦 核心模块 | 模块 | 描述 | |------|------| | `usher-protofuse-common` | 提供项目基础工具类和公共组件 | | `usher-protofuse-call-node` | 分布式执行节点,处理查询执行 | | `usher-protofuse-plan` | SQL解析和执行计划生成 | | `usher-protofuse-protocol-mysql` | MySQL协议实现,支持标准MySQL客户端连接 | | `usher-protofuse-spring` | Spring集成模块,便于与Spring生态系统集成 | ## 🔧 技术栈 - **核心框架**: Java 8 - **网络通信**: Netty - **JSON处理**: FastJSON2 - **连接池**: Druid - **对象映射**: MapStruct - **工具库**: Apache Commons, Google Guava - **构建工具**: Maven ## 🤝 贡献指南 我们欢迎任何形式的贡献! 1. Fork 项目 2. 创建您的特性分支 (`git checkout -b feature/AmazingFeature`) 3. 提交您的更改 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 开启一个 Pull Request ## 📄 许可证 本项目采用 Apache License 2.0 许可证。详情请见 [LICENSE](LICENSE) 文件。 ## 👥 开发者 - **uhyils** - *主要开发者* - uhyils@qq.com ## 🌐 项目链接 - [Gitee 仓库](https://gitee.com/opentech_usher/usher-protofuse) - [GitHub 镜像](https://github.com/your-github-mirror) *(如果适用)* ---
© 2024 Usher-Protofuse. All rights reserved.
```