From 4a0e4802c11165bb99bad99918f715447fa74272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Mon, 29 Dec 2025 16:35:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=BB=84=E4=BB=B6=E5=90=AF=E5=8A=A8=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\345\272\217\350\257\264\346\230\216.md" | 117 ++++++++++++++++++ .../plugins/tool-factory-repository/pom.xml | 2 +- .../plugins/tool-repository-simple/pom.xml | 2 +- ...72\345\272\217\350\257\264\346\230\216.md" | 93 ++++++++++++++ 4 files changed, 212 insertions(+), 2 deletions(-) create mode 100644 "framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" create mode 100644 "framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" diff --git "a/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" new file mode 100644 index 00000000..0cd297dc --- /dev/null +++ "b/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -0,0 +1,117 @@ +# FIT Framework 组件启动顺序说明 + +## 概述 + +本文档记录了 FIT Framework 项目中所有组件的启动顺序(level)配置。Level 值决定了组件在系统启动时的加载顺序,**数值越小,启动优先级越高 +**。 + +**相关文档**: + +- FIT 内置插件详细信息请参见:`framework/fit/java/fit-builtin/plugins/FIT组件启动顺序说明.md` + +## 启动顺序规则 + +- **Level 1**: 最先启动(优先级最高) +- **Level 4**: 第二优先级 +- **Level 5**: 第三优先级 +- **Level 7**: 最后启动(优先级最低) + +## 启动流程图 + +``` +启动时间轴 (从上到下) +│ +├─ Level 1 (最先) ──────────────────────────── +│ ├─ fel-tokenizer-hanlp-plugin (分词器) +│ └─ plugin-log (日志插件) +│ +├─ Level 4 (基础设施层) ────────────────────── +│ ├─ fit-plugin-parent (22个FIT内置插件) +│ ├─ fit-validation-hibernate-jakarta (验证) +│ ├─ fit-validation-hibernate-javax (验证) +│ ├─ fel-tool-repository-simple (工具仓库) +│ └─ fel-tool-factory-repository (工具工厂仓库) +│ +├─ Level 5 (功能层) ────────────────────────── +│ ├─ fel-tool-discoverer (工具发现器) +│ ├─ fel-tool-executor (工具执行器) +│ ├─ fel-tool-mcp-client (MCP客户端) +│ └─ fel-tool-mcp-server (MCP服务端) +│ +└─ Level 7 (最后) ──────────────────────────── + └─ fel-model-openai-plugin (OpenAI模型) +``` + +**说明**: Level 4 中的 FIT 内置插件(22个)详情请参见 `framework/fit/java/fit-builtin/plugins/FIT组件启动顺序说明.md` + +--- + +## 按启动顺序排列的组件列表 + +### Level 1 - 最高优先级(用户级基础组件) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|----------------------------|------|-----------------------------------------------------------|------------------| +| 1 | fel-tokenizer-hanlp-plugin | user | framework/fel/java/fel-community/tokenizer-hanlp | FEL 分词器(HanLP)插件 | +| 2 | plugin-log | user | examples/fit-example/05-aop-log-plugin/plugins/plugin-log | AOP 日志插件示例 | + +**启动说明**: 这些组件最先启动,提供基础的分词和日志功能。 + +--- + +### Level 4 - 第二优先级(基础设施层) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|----------------------------------|--------|-------------------------------------------------------------------------|---------------------| +| 1 | fit-plugin-parent | system | framework/fit/java/fit-builtin/plugins | FIT 内置插件父模块(22个子插件) | +| 2 | fit-validation-hibernate-jakarta | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-jakarta | Jakarta 验证插件 | +| 3 | fit-validation-hibernate-javax | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-javax | Javax 验证插件 | +| 4 | fel-tool-repository-simple | system | framework/fel/java/plugins/tool-repository-simple | FEL 工具仓库(简单实现) | +| 5 | fel-tool-factory-repository | system | framework/fel/java/plugins/tool-factory-repository | FEL 工具工厂仓库 | + +**启动说明**: 基础设施层,包括 FIT 验证组件和 FEL 工具仓库。这些组件提供接口实现,被上层组件依赖。 + +**FIT 插件详情**: 关于 FIT 内置插件的详细信息,请参见 `framework/fit/java/fit-builtin/plugins/组件启动顺序说明.md` + +--- + +### Level 5 - 第三优先级(FEL 工具链功能层) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|---------------------|--------|--------------------------------------------|---------------| +| 1 | fel-tool-discoverer | system | framework/fel/java/plugins/tool-discoverer | FEL 工具发现器 | +| 2 | fel-tool-executor | system | framework/fel/java/plugins/tool-executor | FEL 工具执行器 | +| 3 | fel-tool-mcp-client | system | framework/fel/java/plugins/tool-mcp-client | FEL MCP 客户端工具 | +| 4 | fel-tool-mcp-server | system | framework/fel/java/plugins/tool-mcp-server | FEL MCP 服务端工具 | + +**启动说明**: FEL 工具链功能层,依赖 Level 4 的仓库组件。提供工具发现、执行和 MCP 协议支持。 + +--- + +### Level 7 - 最低优先级(模型集成组件) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|-------------------------|--------|-----------------------------------------------|-----------------| +| 1 | fel-model-openai-plugin | system | framework/fel/java/fel-community/model-openai | FEL OpenAI 模型插件 | + +**启动说明**: 模型集成组件最后加载,确保所有基础设施和工具链已就绪。 + +--- + +## 技术说明 + +### Level 配置位置 + +Level 配置在各组件的 `pom.xml` 文件中,通常位于 Maven 插件配置内: + +```xml + + + org.fitframework + fit-build-maven-plugin + + system + 4 + + +``` \ No newline at end of file diff --git a/framework/fel/java/plugins/tool-factory-repository/pom.xml b/framework/fel/java/plugins/tool-factory-repository/pom.xml index fb2e62fa..4edc7165 100644 --- a/framework/fel/java/plugins/tool-factory-repository/pom.xml +++ b/framework/fel/java/plugins/tool-factory-repository/pom.xml @@ -39,7 +39,7 @@ ${fit.version} system - 5 + 4 diff --git a/framework/fel/java/plugins/tool-repository-simple/pom.xml b/framework/fel/java/plugins/tool-repository-simple/pom.xml index 7147655e..4b7e32fc 100644 --- a/framework/fel/java/plugins/tool-repository-simple/pom.xml +++ b/framework/fel/java/plugins/tool-repository-simple/pom.xml @@ -44,7 +44,7 @@ ${fit.version} system - 5 + 4 diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" new file mode 100644 index 00000000..abda0c67 --- /dev/null +++ "b/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -0,0 +1,93 @@ +# FIT 内置插件启动顺序说明 + +## 概述 + +本文档记录了 FIT Framework 内置插件的启动顺序(level)配置。Level 值决定了组件在系统启动时的加载顺序,**数值越小,启动优先级越高 +**。 + +## 启动流程图 + +``` +启动时间轴 (从上到下) +│ +├─ Level 1 (最先) ──────────────────────────── +│ └─ plugin-log (日志插件) +│ +└─ Level 4 ─────────────────────────────────── + ├─ fit-plugin-parent (插件父模块) + ├─ fit-validation-hibernate-jakarta (验证) + └─ fit-validation-hibernate-javax (验证) +``` + +--- + +## 按启动顺序排列的组件列表 + +### Level 1 - 最高优先级(用户级基础组件) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|------------|------|-----------------------------------------------------------|------------| +| 1 | plugin-log | user | examples/fit-example/05-aop-log-plugin/plugins/plugin-log | AOP 日志插件示例 | + +**启动说明**: 用户级示例插件,最先启动。 + +--- + +### Level 4 - 第二优先级(FIT 内置系统组件) + +| 序号 | 组件名称 | 类别 | 路径 | 说明 | +|----|----------------------------------|--------|-------------------------------------------------------------------------|--------------| +| 1 | fit-plugin-parent | system | framework/fit/java/fit-builtin/plugins | FIT 内置插件父模块 | +| 2 | fit-validation-hibernate-jakarta | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-jakarta | Jakarta 验证插件 | +| 3 | fit-validation-hibernate-javax | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-javax | Javax 验证插件 | + +**启动说明**: FIT 框架的验证组件,在基础组件之后加载。 + +--- + +## FIT 内置插件列表 + +`fit-plugin-parent` 下的所有子模块(22个)都继承 `level=4` 配置: + +1. **fit-actuator** - 监控端点 +2. **fit-client-http** - HTTP 客户端 +3. **fit-dynamic-plugin-directory** - 动态插件目录加载 +4. **fit-dynamic-plugin-mvn** - Maven 动态插件 +5. **fit-heartbeat-client** - 心跳客户端 +6. **fit-http-client-okhttp** - OkHttp 客户端 +7. **fit-http-handler-registry** - HTTP 处理器注册 +8. **fit-http-openapi3-swagger** - OpenAPI 3/Swagger 支持 +9. **fit-http-server-netty** - Netty HTTP 服务器 +10. **fit-logger** - 日志组件 +11. **fit-message-serializer-cbor** - CBOR 序列化 +12. **fit-message-serializer-json-jackson** - Jackson JSON 序列化 +13. **fit-security-simple** - 简单安全实现 +14. **fit-server-http** - HTTP 服务器 +15. **fit-service-coordination-locator** - 服务定位器 +16. **fit-service-coordination-simple** - 简单服务协调 +17. **fit-service-coordination-nacos** - Nacos 服务协调 +18. **fit-service-discovery** - 服务发现 +19. **fit-service-registry** - 服务注册 +20. **fit-value-fastjson** - Fastjson 支持 +21. **fit-validation-hibernate-jakarta** - Jakarta 验证 +22. **fit-validation-hibernate-javax** - Javax 验证 + +--- + +## 技术说明 + +### Level 配置位置 + +Level 配置在各组件的 `pom.xml` 文件中,通常位于 Maven 插件配置内: + +```xml + + + org.fitframework + fit-build-maven-plugin + + system + 4 + + +``` From 421d583b8d1cbdfe10bd7dca7632637422fe6371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Tue, 30 Dec 2025 10:31:49 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\345\272\217\350\257\264\346\230\216.md" | 106 ++++++++++ ...72\345\272\217\350\257\264\346\230\216.md" | 117 ----------- ...72\345\272\217\350\257\264\346\230\216.md" | 183 ++++++++++++++++++ ...72\345\272\217\350\257\264\346\230\216.md" | 93 --------- 4 files changed, 289 insertions(+), 210 deletions(-) create mode 100644 "framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" delete mode 100644 "framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" create mode 100644 "framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" delete mode 100644 "framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" diff --git "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" new file mode 100644 index 00000000..fe90e925 --- /dev/null +++ "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -0,0 +1,106 @@ +# FIT Framework 插件启动顺序说明 + +## 概述 + +本文档记录了 `build/plugins/` 目录下所有插件的启动顺序。当应用以 JAR 包方式运行时,FIT 框架会按照 **Level** +值从小到大的顺序加载这些插件。 + +**build/plugins 插件统计**: + +- **FEL 插件**: 9个(本文档详细说明) +- **FIT 内置插件**: 20个(详见 `framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md`) + +**启动规则**: + +- **数值越小,启动优先级越高** +- **同一 Level 内按文件名字母顺序加载** +- **category=SYSTEM 的插件先于 USER 插件加载** + +--- + +## 启动流程图 + +``` +按以下顺序加载 29 个插件: +├─ Level 1 (最先) ──────────────────────────── +│ └─ fel-tokenizer-hanlp-plugin +│ +├─ Level 4 (基础设施层) ────────────────────── +│ ├─ FEL 插件 (3个) +│ │ ├─ fel-tool-factory-repository +│ │ ├─ fel-tool-repository-simple +│ │ └─ fel-langchain-runnable +│ └─ FIT 内置插件 (20个,详见FIT文档) +│ +├─ Level 5 (功能层) ────────────────────────── +│ └─ FEL 工具链 (4个) +│ ├─ fel-tool-discoverer +│ ├─ fel-tool-executor +│ ├─ fel-tool-mcp-client +│ └─ fel-tool-mcp-server +│ +└─ Level 7 (最后) ──────────────────────────── + └─ fel-model-openai-plugin +``` + +--- + +## FEL插件清单(按启动顺序) + +### Level 1 - 第一批启动(1个插件) + +| 序号 | 插件名称 | Category | 说明 | +|----|------------------------------|----------|-----------| +| 1 | `fel-tokenizer-hanlp-plugin` | user | HanLP 分词器 | + +**启动时机**: 应用启动后最先加载,提供基础分词功能。 + +--- + +### Level 4 - 第二批启动(23个插件) + +#### FEL 插件(3个) + +| 序号 | 插件名称 | Category | 说明 | +|----|-------------------------------|----------|-----------------| +| 1 | `fel-langchain-runnable` | user | LangChain 运行时支持 | +| 2 | `fel-tool-factory-repository` | system | 工具工厂仓库 | +| 3 | `fel-tool-repository-simple` | system | 工具仓库(简单实现) | + +#### FIT 内置插件(20个) + +Level 4 还包含 20 个 FIT 框架内置插件(category=system),提供 HTTP 服务、序列化、验证、服务发现等核心功能。 + +**FIT 插件详情**: 请参见 `framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md` + +**加载顺序说明**: + +- 先加载所有 category=SYSTEM 的插件(按文件名字母顺序) + - FIT 内置插件(20个,以 fit- 开头) + - FEL 工具仓库(2个) +- 再加载 category=USER 的插件 + - fel-langchain-runnable + +--- + +### Level 5 - 第三批启动(4个插件) + +| 序号 | 插件名称 | Category | 说明 | +|----|-----------------------|----------|---------| +| 1 | `fel-tool-discoverer` | system | 工具发现器 | +| 2 | `fel-tool-executor` | system | 工具执行器 | +| 3 | `fel-tool-mcp-client` | system | MCP 客户端 | +| 4 | `fel-tool-mcp-server` | system | MCP 服务端 | + +**启动时机**: Level 4 的工具仓库加载完成后启动。这些插件依赖 Level 4 的 `fel-tool-repository-simple` 和 +`fel-tool-factory-repository`,提供工具发现、执行和 MCP 协议支持。 + +--- + +### Level 7 - 最后启动(1个插件) + +| 序号 | 插件名称 | Category | 说明 | +|----|---------------------------|----------|-------------| +| 1 | `fel-model-openai-plugin` | system | OpenAI 模型集成 | + +**启动时机**: 所有基础设施和工具链加载完成后最后启动,确保环境完全就绪。 \ No newline at end of file diff --git "a/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" deleted file mode 100644 index 0cd297dc..00000000 --- "a/framework/fel/java/plugins/FEL\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ /dev/null @@ -1,117 +0,0 @@ -# FIT Framework 组件启动顺序说明 - -## 概述 - -本文档记录了 FIT Framework 项目中所有组件的启动顺序(level)配置。Level 值决定了组件在系统启动时的加载顺序,**数值越小,启动优先级越高 -**。 - -**相关文档**: - -- FIT 内置插件详细信息请参见:`framework/fit/java/fit-builtin/plugins/FIT组件启动顺序说明.md` - -## 启动顺序规则 - -- **Level 1**: 最先启动(优先级最高) -- **Level 4**: 第二优先级 -- **Level 5**: 第三优先级 -- **Level 7**: 最后启动(优先级最低) - -## 启动流程图 - -``` -启动时间轴 (从上到下) -│ -├─ Level 1 (最先) ──────────────────────────── -│ ├─ fel-tokenizer-hanlp-plugin (分词器) -│ └─ plugin-log (日志插件) -│ -├─ Level 4 (基础设施层) ────────────────────── -│ ├─ fit-plugin-parent (22个FIT内置插件) -│ ├─ fit-validation-hibernate-jakarta (验证) -│ ├─ fit-validation-hibernate-javax (验证) -│ ├─ fel-tool-repository-simple (工具仓库) -│ └─ fel-tool-factory-repository (工具工厂仓库) -│ -├─ Level 5 (功能层) ────────────────────────── -│ ├─ fel-tool-discoverer (工具发现器) -│ ├─ fel-tool-executor (工具执行器) -│ ├─ fel-tool-mcp-client (MCP客户端) -│ └─ fel-tool-mcp-server (MCP服务端) -│ -└─ Level 7 (最后) ──────────────────────────── - └─ fel-model-openai-plugin (OpenAI模型) -``` - -**说明**: Level 4 中的 FIT 内置插件(22个)详情请参见 `framework/fit/java/fit-builtin/plugins/FIT组件启动顺序说明.md` - ---- - -## 按启动顺序排列的组件列表 - -### Level 1 - 最高优先级(用户级基础组件) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|----------------------------|------|-----------------------------------------------------------|------------------| -| 1 | fel-tokenizer-hanlp-plugin | user | framework/fel/java/fel-community/tokenizer-hanlp | FEL 分词器(HanLP)插件 | -| 2 | plugin-log | user | examples/fit-example/05-aop-log-plugin/plugins/plugin-log | AOP 日志插件示例 | - -**启动说明**: 这些组件最先启动,提供基础的分词和日志功能。 - ---- - -### Level 4 - 第二优先级(基础设施层) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|----------------------------------|--------|-------------------------------------------------------------------------|---------------------| -| 1 | fit-plugin-parent | system | framework/fit/java/fit-builtin/plugins | FIT 内置插件父模块(22个子插件) | -| 2 | fit-validation-hibernate-jakarta | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-jakarta | Jakarta 验证插件 | -| 3 | fit-validation-hibernate-javax | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-javax | Javax 验证插件 | -| 4 | fel-tool-repository-simple | system | framework/fel/java/plugins/tool-repository-simple | FEL 工具仓库(简单实现) | -| 5 | fel-tool-factory-repository | system | framework/fel/java/plugins/tool-factory-repository | FEL 工具工厂仓库 | - -**启动说明**: 基础设施层,包括 FIT 验证组件和 FEL 工具仓库。这些组件提供接口实现,被上层组件依赖。 - -**FIT 插件详情**: 关于 FIT 内置插件的详细信息,请参见 `framework/fit/java/fit-builtin/plugins/组件启动顺序说明.md` - ---- - -### Level 5 - 第三优先级(FEL 工具链功能层) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|---------------------|--------|--------------------------------------------|---------------| -| 1 | fel-tool-discoverer | system | framework/fel/java/plugins/tool-discoverer | FEL 工具发现器 | -| 2 | fel-tool-executor | system | framework/fel/java/plugins/tool-executor | FEL 工具执行器 | -| 3 | fel-tool-mcp-client | system | framework/fel/java/plugins/tool-mcp-client | FEL MCP 客户端工具 | -| 4 | fel-tool-mcp-server | system | framework/fel/java/plugins/tool-mcp-server | FEL MCP 服务端工具 | - -**启动说明**: FEL 工具链功能层,依赖 Level 4 的仓库组件。提供工具发现、执行和 MCP 协议支持。 - ---- - -### Level 7 - 最低优先级(模型集成组件) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|-------------------------|--------|-----------------------------------------------|-----------------| -| 1 | fel-model-openai-plugin | system | framework/fel/java/fel-community/model-openai | FEL OpenAI 模型插件 | - -**启动说明**: 模型集成组件最后加载,确保所有基础设施和工具链已就绪。 - ---- - -## 技术说明 - -### Level 配置位置 - -Level 配置在各组件的 `pom.xml` 文件中,通常位于 Maven 插件配置内: - -```xml - - - org.fitframework - fit-build-maven-plugin - - system - 4 - - -``` \ No newline at end of file diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" new file mode 100644 index 00000000..7a67ae00 --- /dev/null +++ "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -0,0 +1,183 @@ +# FIT 内置插件启动顺序说明 + +## 概述 + +本文档记录了 FIT Framework 内置插件的启动顺序。FIT 内置插件共定义了 **22 个**,其中: + +- **20 个**会自动输出到 `build/plugins/` 目录 +- **2 个**不在 `build/plugins/` 目录中(需单独配置) + +所有 FIT 插件均配置为 **Level 4, category=system**,在应用启动的第二批加载。 + +--- + +## 自动添加的FIT插件(20个) + +### Level 4 - 自动加载的插件 + +这 20 个插件会在构建时自动复制到 `build/plugins/` 目录,按**文件名字母顺序**加载: + +| 序号 | 插件名称 | 说明 | +|----|---------------------------------------|-------------------| +| 1 | `fit-actuator` | 监控端点 | +| 2 | `fit-client-http` | HTTP 客户端 | +| 3 | `fit-dynamic-plugin-directory` | 动态插件目录 | +| 4 | `fit-heartbeat-client` | 心跳客户端 | +| 5 | `fit-http-client-okhttp` | OkHttp 客户端 | +| 6 | `fit-http-handler-registry` | HTTP 处理器注册 | +| 7 | `fit-http-openapi3-swagger` | OpenAPI 3/Swagger | +| 8 | `fit-http-server-netty` | Netty HTTP 服务器 | +| 9 | `fit-logger` | 日志组件 | +| 10 | `fit-message-serializer-cbor` | CBOR 序列化 | +| 11 | `fit-message-serializer-json-jackson` | Jackson JSON 序列化 | +| 12 | `fit-security-simple` | 简单安全 | +| 13 | `fit-server-http` | HTTP 服务器 | +| 14 | `fit-service-coordination-locator` | 服务定位 | +| 15 | `fit-service-coordination-simple` | 简单服务协调 | +| 16 | `fit-service-discovery` | 服务发现 | +| 17 | `fit-service-registry` | 服务注册 | +| 18 | `fit-validation-hibernate-jakarta` | Jakarta 验证 | +| 19 | `fit-validation-hibernate-javax` | Javax 验证 | +| 20 | `fit-value-fastjson` | Fastjson 支持 | + +--- + +## 需要手动添加的插件(2个) + +以下插件在源码中定义,但**不会自动输出**到 `build/plugins/` 目录,需要手动添加: + +### 1. fit-dynamic-plugin-mvn + +| 属性 | 值 | +|--------------|-----------------------------------------------------------------| +| **插件名** | fit-dynamic-plugin-mvn | +| **Level** | 4 | +| **Category** | system | +| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-dynamic-plugin-mvn` | +| **说明** | Maven 动态插件加载器 | +| **用途** | 从 Maven 仓库动态加载插件 | + +### 2. fit-service-coordination-nacos + +| 属性 | 值 | +|--------------|-------------------------------------------------------------------------| +| **插件名** | fit-service-coordination-nacos | +| **Level** | 4 | +| **Category** | system | +| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-service-coordination-nacos` | +| **说明** | Nacos 服务协调实现 | +| **用途** | 使用 Nacos 进行服务注册和发现 | + +--- + +## 插件功能分类 + +虽然所有 FIT 插件都在 Level 4 启动,但它们提供不同类别的功能: + +### HTTP 服务相关(7个) + +- `fit-client-http` - HTTP 客户端接口 +- `fit-http-client-okhttp` - OkHttp 客户端实现 +- `fit-http-handler-registry` - HTTP 处理器注册 +- `fit-http-openapi3-swagger` - OpenAPI 3 和 Swagger UI +- `fit-http-server-netty` - Netty HTTP 服务器实现 +- `fit-server-http` - HTTP 服务器接口 +- `fit-heartbeat-client` - 心跳客户端 + +### 序列化相关(3个) + +- `fit-message-serializer-cbor` - CBOR 格式序列化 +- `fit-message-serializer-json-jackson` - JSON 格式序列化(Jackson) +- `fit-value-fastjson` - Fastjson 值支持 + +### 服务协调相关(5个,其中1个可选) + +- `fit-service-coordination-locator` - 服务定位器 +- `fit-service-coordination-simple` - 简单服务协调实现(默认) +- `fit-service-coordination-nacos` - Nacos 服务协调实现(可选,不在 build/plugins) +- `fit-service-discovery` - 服务发现 +- `fit-service-registry` - 服务注册 + +### 验证和安全(3个) + +- `fit-validation-hibernate-jakarta` - Jakarta Bean Validation +- `fit-validation-hibernate-javax` - Javax Bean Validation +- `fit-security-simple` - 简单安全实现 + +### 动态插件加载(2个,其中1个可选) + +- `fit-dynamic-plugin-directory` - 从目录加载插件(默认) +- `fit-dynamic-plugin-mvn` - 从 Maven 仓库加载插件(可选,不在 build/plugins) + +### 其他(2个) + +- `fit-actuator` - 应用监控端点 +- `fit-logger` - 日志组件 + +--- + +## 源代码位置 + +所有 FIT 内置插件的源码位于:`framework/fit/java/fit-builtin/plugins/` + +``` +framework/fit/java/fit-builtin/plugins/ +├── pom.xml # 父 POM,统一配置 level=4 +│ +├── fit-actuator/ +├── fit-client-http/ +├── fit-dynamic-plugin-directory/ +├── fit-dynamic-plugin-mvn/ # 不会自动输出到build/plugins +├── fit-heartbeat-client/ +├── fit-http-client-okhttp/ +├── fit-http-handler-registry/ +├── fit-http-openapi3-swagger/ +├── fit-http-server-netty/ +├── fit-logger/ +├── fit-message-serializer-cbor/ +├── fit-message-serializer-json-jackson/ +├── fit-security-simple/ +├── fit-server-http/ +├── fit-service-coordination-locator/ +├── fit-service-coordination-simple/ +├── fit-service-coordination-nacos/ # 不会自动输出到build/plugins +├── fit-service-discovery/ +├── fit-service-registry/ +├── fit-validation-hibernate-jakarta/ +├── fit-validation-hibernate-javax/ +└── fit-value-fastjson/ +``` + +### 父 POM 配置 + +所有 FIT 内置插件继承自 `fit-builtin/plugins/pom.xml`,该文件统一配置了: + +```xml + + + + + org.fitframework + fit-build-maven-plugin + + system + 4 + + + + build-plugin + + build-plugin + + + + package-plugin + + package-plugin + + + + + + +``` diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" deleted file mode 100644 index abda0c67..00000000 --- "a/framework/fit/java/fit-builtin/plugins/FIT\347\273\204\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ /dev/null @@ -1,93 +0,0 @@ -# FIT 内置插件启动顺序说明 - -## 概述 - -本文档记录了 FIT Framework 内置插件的启动顺序(level)配置。Level 值决定了组件在系统启动时的加载顺序,**数值越小,启动优先级越高 -**。 - -## 启动流程图 - -``` -启动时间轴 (从上到下) -│ -├─ Level 1 (最先) ──────────────────────────── -│ └─ plugin-log (日志插件) -│ -└─ Level 4 ─────────────────────────────────── - ├─ fit-plugin-parent (插件父模块) - ├─ fit-validation-hibernate-jakarta (验证) - └─ fit-validation-hibernate-javax (验证) -``` - ---- - -## 按启动顺序排列的组件列表 - -### Level 1 - 最高优先级(用户级基础组件) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|------------|------|-----------------------------------------------------------|------------| -| 1 | plugin-log | user | examples/fit-example/05-aop-log-plugin/plugins/plugin-log | AOP 日志插件示例 | - -**启动说明**: 用户级示例插件,最先启动。 - ---- - -### Level 4 - 第二优先级(FIT 内置系统组件) - -| 序号 | 组件名称 | 类别 | 路径 | 说明 | -|----|----------------------------------|--------|-------------------------------------------------------------------------|--------------| -| 1 | fit-plugin-parent | system | framework/fit/java/fit-builtin/plugins | FIT 内置插件父模块 | -| 2 | fit-validation-hibernate-jakarta | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-jakarta | Jakarta 验证插件 | -| 3 | fit-validation-hibernate-javax | system | framework/fit/java/fit-builtin/plugins/fit-validation-hibernate-javax | Javax 验证插件 | - -**启动说明**: FIT 框架的验证组件,在基础组件之后加载。 - ---- - -## FIT 内置插件列表 - -`fit-plugin-parent` 下的所有子模块(22个)都继承 `level=4` 配置: - -1. **fit-actuator** - 监控端点 -2. **fit-client-http** - HTTP 客户端 -3. **fit-dynamic-plugin-directory** - 动态插件目录加载 -4. **fit-dynamic-plugin-mvn** - Maven 动态插件 -5. **fit-heartbeat-client** - 心跳客户端 -6. **fit-http-client-okhttp** - OkHttp 客户端 -7. **fit-http-handler-registry** - HTTP 处理器注册 -8. **fit-http-openapi3-swagger** - OpenAPI 3/Swagger 支持 -9. **fit-http-server-netty** - Netty HTTP 服务器 -10. **fit-logger** - 日志组件 -11. **fit-message-serializer-cbor** - CBOR 序列化 -12. **fit-message-serializer-json-jackson** - Jackson JSON 序列化 -13. **fit-security-simple** - 简单安全实现 -14. **fit-server-http** - HTTP 服务器 -15. **fit-service-coordination-locator** - 服务定位器 -16. **fit-service-coordination-simple** - 简单服务协调 -17. **fit-service-coordination-nacos** - Nacos 服务协调 -18. **fit-service-discovery** - 服务发现 -19. **fit-service-registry** - 服务注册 -20. **fit-value-fastjson** - Fastjson 支持 -21. **fit-validation-hibernate-jakarta** - Jakarta 验证 -22. **fit-validation-hibernate-javax** - Javax 验证 - ---- - -## 技术说明 - -### Level 配置位置 - -Level 配置在各组件的 `pom.xml` 文件中,通常位于 Maven 插件配置内: - -```xml - - - org.fitframework - fit-build-maven-plugin - - system - 4 - - -``` From 9129ab9bb11faa6c0ca32b25fd858d3517a133d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Tue, 30 Dec 2025 10:35:16 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2\250\351\241\272\345\272\217\350\257\264\346\230\216.md" | 5 ++--- ...2\250\351\241\272\345\272\217\350\257\264\346\230\216.md" | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index fe90e925..51ac8448 100644 --- "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -1,9 +1,8 @@ -# FIT Framework 插件启动顺序说明 +# FEL插件启动顺序说明 ## 概述 -本文档记录了 `build/plugins/` 目录下所有插件的启动顺序。当应用以 JAR 包方式运行时,FIT 框架会按照 **Level** -值从小到大的顺序加载这些插件。 +本文档记录了 FEL 插件的启动顺序。当应用以 JAR 包方式运行时,FIT 框架会按照 **Level**值从小到大的顺序加载这些插件。 **build/plugins 插件统计**: diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 7a67ae00..76d5af3d 100644 --- "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -1,4 +1,4 @@ -# FIT 内置插件启动顺序说明 +# FIT插件启动顺序说明 ## 概述 From 8d0b186ea1e792a4114534147c10e48da7962a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Tue, 30 Dec 2025 15:38:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\345\272\217\350\257\264\346\230\216.md" | 121 +++++++++--------- ...72\345\272\217\350\257\264\346\230\216.md" | 76 +++++++---- 2 files changed, 118 insertions(+), 79 deletions(-) diff --git "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 51ac8448..864446ce 100644 --- "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -11,95 +11,102 @@ **启动规则**: -- **数值越小,启动优先级越高** -- **同一 Level 内按文件名字母顺序加载** -- **category=SYSTEM 的插件先于 USER 插件加载** +- **category=SYSTEM (id=1) 的插件先于 USER (id=2) 插件加载** +- **相同 category 内,level 数值越小,启动优先级越高** +- **相同 category 和 level 的插件,加载顺序不确定** --- ## 启动流程图 +**启动顺序(两级排序:category → level)** + ``` -按以下顺序加载 29 个插件: -├─ Level 1 (最先) ──────────────────────────── -│ └─ fel-tokenizer-hanlp-plugin +插件启动顺序(29个插件) │ -├─ Level 4 (基础设施层) ────────────────────── -│ ├─ FEL 插件 (3个) +├─ Category 1: SYSTEM (id=1) ─────────── 第一优先级,先启动所有系统插件 +│ │ +│ ├─ Level 4 (22个) +│ │ ├─ FIT 内置插件 (20个,详见FIT文档) │ │ ├─ fel-tool-factory-repository -│ │ ├─ fel-tool-repository-simple -│ │ └─ fel-langchain-runnable -│ └─ FIT 内置插件 (20个,详见FIT文档) -│ -├─ Level 5 (功能层) ────────────────────────── -│ └─ FEL 工具链 (4个) -│ ├─ fel-tool-discoverer -│ ├─ fel-tool-executor -│ ├─ fel-tool-mcp-client -│ └─ fel-tool-mcp-server +│ │ └─ fel-tool-repository-simple +│ │ +│ ├─ Level 5 (4个) +│ │ ├─ fel-tool-discoverer +│ │ ├─ fel-tool-executor +│ │ ├─ fel-tool-mcp-client +│ │ └─ fel-tool-mcp-server +│ │ +│ └─ Level 7 (1个) +│ └─ fel-model-openai-plugin │ -└─ Level 7 (最后) ──────────────────────────── - └─ fel-model-openai-plugin +└─ Category 2: USER (id=2) ─────────── 第二优先级,再启动所有用户插件 + │ + ├─ Level 1 (1个) + │ └─ fel-tokenizer-hanlp-plugin + │ + └─ Level 4 (1个) + └─ fel-langchain-runnable ``` --- -## FEL插件清单(按启动顺序) +## FEL插件清单 -### Level 1 - 第一批启动(1个插件) +### 阶段1: SYSTEM 插件 -| 序号 | 插件名称 | Category | 说明 | -|----|------------------------------|----------|-----------| -| 1 | `fel-tokenizer-hanlp-plugin` | user | HanLP 分词器 | +#### category=SYSTEM, level=4 (2个) -**启动时机**: 应用启动后最先加载,提供基础分词功能。 +| 插件名称 | 说明 | +|-------------------------------|------------| +| `fel-tool-factory-repository` | 工具工厂仓库 | +| `fel-tool-repository-simple` | 工具仓库(简单实现) | ---- +**FIT 内置插件**: Level 4 还包含 20 个 FIT 框架内置插件(category=SYSTEM),提供 HTTP 服务、序列化、验证、服务发现等核心功能。详见 `framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md` -### Level 4 - 第二批启动(23个插件) +**启动时机**: 第一批启动,提供基础工具仓库能力。 -#### FEL 插件(3个) +--- -| 序号 | 插件名称 | Category | 说明 | -|----|-------------------------------|----------|-----------------| -| 1 | `fel-langchain-runnable` | user | LangChain 运行时支持 | -| 2 | `fel-tool-factory-repository` | system | 工具工厂仓库 | -| 3 | `fel-tool-repository-simple` | system | 工具仓库(简单实现) | +#### category=SYSTEM, level=5 (4个) -#### FIT 内置插件(20个) +| 插件名称 | 说明 | +|-----------------------|---------| +| `fel-tool-discoverer` | 工具发现器 | +| `fel-tool-executor` | 工具执行器 | +| `fel-tool-mcp-client` | MCP 客户端 | +| `fel-tool-mcp-server` | MCP 服务端 | -Level 4 还包含 20 个 FIT 框架内置插件(category=system),提供 HTTP 服务、序列化、验证、服务发现等核心功能。 +**启动时机**: Level 4 的工具仓库加载完成后启动。这些插件依赖 Level 4 的 `fel-tool-repository-simple` 和 `fel-tool-factory-repository`,提供工具发现、执行和 MCP 协议支持。 -**FIT 插件详情**: 请参见 `framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md` +--- + +#### category=SYSTEM, level=7 (1个) -**加载顺序说明**: +| 插件名称 | 说明 | +|---------------------------|-------------| +| `fel-model-openai-plugin` | OpenAI 模型集成 | -- 先加载所有 category=SYSTEM 的插件(按文件名字母顺序) - - FIT 内置插件(20个,以 fit- 开头) - - FEL 工具仓库(2个) -- 再加载 category=USER 的插件 - - fel-langchain-runnable +**启动时机**: 所有 SYSTEM 插件中最后启动,确保基础设施和工具链完全就绪。 --- -### Level 5 - 第三批启动(4个插件) +### 阶段2: USER 插件 + +#### category=USER, level=1 (1个) -| 序号 | 插件名称 | Category | 说明 | -|----|-----------------------|----------|---------| -| 1 | `fel-tool-discoverer` | system | 工具发现器 | -| 2 | `fel-tool-executor` | system | 工具执行器 | -| 3 | `fel-tool-mcp-client` | system | MCP 客户端 | -| 4 | `fel-tool-mcp-server` | system | MCP 服务端 | +| 插件名称 | 说明 | +|------------------------------|-----------| +| `fel-tokenizer-hanlp-plugin` | HanLP 分词器 | -**启动时机**: Level 4 的工具仓库加载完成后启动。这些插件依赖 Level 4 的 `fel-tool-repository-simple` 和 -`fel-tool-factory-repository`,提供工具发现、执行和 MCP 协议支持。 +**启动时机**: 所有 SYSTEM 插件启动完成后,USER 插件中最先加载,提供基础分词功能。 --- -### Level 7 - 最后启动(1个插件) +#### category=USER, level=4 (1个) -| 序号 | 插件名称 | Category | 说明 | -|----|---------------------------|----------|-------------| -| 1 | `fel-model-openai-plugin` | system | OpenAI 模型集成 | +| 插件名称 | 说明 | +|--------------------------|-----------------| +| `fel-langchain-runnable` | LangChain 运行时支持 | -**启动时机**: 所有基础设施和工具链加载完成后最后启动,确保环境完全就绪。 \ No newline at end of file +**启动时机**: USER 插件中 Level 1 启动完成后加载。 \ No newline at end of file diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 76d5af3d..e54bc256 100644 --- "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -7,15 +7,49 @@ - **20 个**会自动输出到 `build/plugins/` 目录 - **2 个**不在 `build/plugins/` 目录中(需单独配置) -所有 FIT 插件均配置为 **Level 4, category=system**,在应用启动的第二批加载。 +所有 FIT 插件均配置为 **category=SYSTEM, level=4**。 --- -## 自动添加的FIT插件(20个) +## 启动顺序说明 -### Level 4 - 自动加载的插件 +### 整体启动阶段 -这 20 个插件会在构建时自动复制到 `build/plugins/` 目录,按**文件名字母顺序**加载: +``` +FIT 框架启动流程 +│ +├─ 阶段0: 运行时初始化 +│ └─ 注册系统 Bean(配置、AOP、Broker等) +│ +├─ 阶段1: SYSTEM 插件启动(按 level 排序) +│ ├─ Level 4 (22个) +│ │ ├─ FIT 内置插件(20个) +│ │ └─ FEL 工具仓库(2个) +│ ├─ Level 5 (4个) +│ │ └─ FEL 工具链(fel-tool-discoverer等) +│ └─ Level 7 (1个) +│ └─ FEL 模型集成(fel-model-openai-plugin) +│ +└─ 阶段2: USER 插件启动(按 level 排序) + ├─ Level 1 (1个) + │ └─ FEL 用户插件(fel-tokenizer-hanlp-plugin) + └─ Level 4 (1个) + └─ FEL 用户插件(fel-langchain-runnable) +``` + +**FIT 内置插件在 SYSTEM Level 4,与 FEL 工具仓库插件一起,是所有插件中最先启动的一批。** + +### 启动规则 + +- **category=SYSTEM (id=1) 的插件先于 USER (id=2) 插件加载** +- **相同 category 内,level 数值越小,启动优先级越高** +- **相同 category 和 level 的插件,加载顺序不确定** + +--- + +## 自动添加的FIT插件 + +这 20 个插件会在构建时自动复制到 `build/plugins/` 目录(插件均配置为 category=SYSTEM, level=4): | 序号 | 插件名称 | 说明 | |----|---------------------------------------|-------------------| @@ -40,33 +74,31 @@ | 19 | `fit-validation-hibernate-javax` | Javax 验证 | | 20 | `fit-value-fastjson` | Fastjson 支持 | +**注意**: 表格中的序号仅用于标识,不代表实际加载顺序。相同 category 和 level 的插件之间的加载顺序是不确定的。 + --- -## 需要手动添加的插件(2个) +## 需要手动添加的插件 -以下插件在源码中定义,但**不会自动输出**到 `build/plugins/` 目录,需要手动添加: +以下插件在源码中定义,但**不会自动输出**到 `build/plugins/` 目录,需要手动添加(插件均配置为 category=SYSTEM, level=4): ### 1. fit-dynamic-plugin-mvn -| 属性 | 值 | -|--------------|-----------------------------------------------------------------| -| **插件名** | fit-dynamic-plugin-mvn | -| **Level** | 4 | -| **Category** | system | -| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-dynamic-plugin-mvn` | -| **说明** | Maven 动态插件加载器 | -| **用途** | 从 Maven 仓库动态加载插件 | +| 属性 | 值 | +|----------|-----------------------------------------------------------------| +| **插件名** | fit-dynamic-plugin-mvn | +| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-dynamic-plugin-mvn` | +| **说明** | Maven 动态插件加载器 | +| **用途** | 从 Maven 仓库动态加载插件 | ### 2. fit-service-coordination-nacos -| 属性 | 值 | -|--------------|-------------------------------------------------------------------------| -| **插件名** | fit-service-coordination-nacos | -| **Level** | 4 | -| **Category** | system | -| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-service-coordination-nacos` | -| **说明** | Nacos 服务协调实现 | -| **用途** | 使用 Nacos 进行服务注册和发现 | +| 属性 | 值 | +|----------|-------------------------------------------------------------------------| +| **插件名** | fit-service-coordination-nacos | +| **源码路径** | `framework/fit/java/fit-builtin/plugins/fit-service-coordination-nacos` | +| **说明** | Nacos 服务协调实现 | +| **用途** | 使用 Nacos 进行服务注册和发现 | --- From 45df21014e32f85217c561b12275aa82e190b9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Tue, 30 Dec 2025 19:35:47 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...241\272\345\272\217\350\257\264\346\230\216.md" | 6 +++--- ...241\272\345\272\217\350\257\264\346\230\216.md" | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 864446ce..0f1924ab 100644 --- "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -24,7 +24,7 @@ ``` 插件启动顺序(29个插件) │ -├─ Category 1: SYSTEM (id=1) ─────────── 第一优先级,先启动所有系统插件 +├─ 阶段1: SYSTEM 插件启动 │ │ │ ├─ Level 4 (22个) │ │ ├─ FIT 内置插件 (20个,详见FIT文档) @@ -40,8 +40,8 @@ │ └─ Level 7 (1个) │ └─ fel-model-openai-plugin │ -└─ Category 2: USER (id=2) ─────────── 第二优先级,再启动所有用户插件 - │ +└─ 阶段2: USER 插件启动 + ├─ Level 1 (1个) │ └─ fel-tokenizer-hanlp-plugin │ diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index e54bc256..0e1620bd 100644 --- "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -16,23 +16,25 @@ ### 整体启动阶段 ``` -FIT 框架启动流程 +FIT 框架插件启动顺序 │ -├─ 阶段0: 运行时初始化 -│ └─ 注册系统 Bean(配置、AOP、Broker等) -│ -├─ 阶段1: SYSTEM 插件启动(按 level 排序) +├─ 阶段1: SYSTEM 插件启动 +│ │ │ ├─ Level 4 (22个) │ │ ├─ FIT 内置插件(20个) │ │ └─ FEL 工具仓库(2个) +│ │ │ ├─ Level 5 (4个) │ │ └─ FEL 工具链(fel-tool-discoverer等) +│ │ │ └─ Level 7 (1个) │ └─ FEL 模型集成(fel-model-openai-plugin) │ -└─ 阶段2: USER 插件启动(按 level 排序) +└─ 阶段2: USER 插件启动 + │ ├─ Level 1 (1个) │ └─ FEL 用户插件(fel-tokenizer-hanlp-plugin) + │ └─ Level 4 (1个) └─ FEL 用户插件(fel-langchain-runnable) ``` From 7bfe87d7f4c2488a0da450f1834b9ee898791759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=8F=AF=E6=AC=A3?= <2218887102@qq.com> Date: Wed, 31 Dec 2025 16:21:13 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\345\272\217\350\257\264\346\230\216.md" | 60 ++++++++++--------- .../plugins/tool-factory-repository/pom.xml | 2 +- ...72\345\272\217\350\257\264\346\230\216.md" | 23 +++---- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 0f1924ab..c5c174a5 100644 --- "a/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fel/java/plugins/FEL\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -15,6 +15,11 @@ - **相同 category 内,level 数值越小,启动优先级越高** - **相同 category 和 level 的插件,加载顺序不确定** +**默认值**: + +- 未指定 category 时,默认为 **category=USER** +- 未指定 level 时,默认为 **level=4** + --- ## 启动流程图 @@ -26,14 +31,14 @@ │ ├─ 阶段1: SYSTEM 插件启动 │ │ -│ ├─ Level 4 (22个) +│ ├─ Level 4 (21个) │ │ ├─ FIT 内置插件 (20个,详见FIT文档) -│ │ ├─ fel-tool-factory-repository │ │ └─ fel-tool-repository-simple │ │ -│ ├─ Level 5 (4个) +│ ├─ Level 5 (5个) │ │ ├─ fel-tool-discoverer │ │ ├─ fel-tool-executor +│ │ ├─ fel-tool-factory-repository │ │ ├─ fel-tool-mcp-client │ │ └─ fel-tool-mcp-server │ │ @@ -51,33 +56,40 @@ --- +## 插件依赖关系 + +### 启动时依赖 + +| 依赖方插件 | 被依赖插件 | 依赖说明 | +|---------------------------------|----------------------------------------|--------------------------------------------| +| `fel-tool-discoverer` (Level 5) | `fel-tool-repository-simple` (Level 4) | 在 `onPluginStarted()` 回调时调用 `addTool()` 方法 | + +--- + ## FEL插件清单 ### 阶段1: SYSTEM 插件 -#### category=SYSTEM, level=4 (2个) +#### category=SYSTEM, level=4 (1个) -| 插件名称 | 说明 | -|-------------------------------|------------| -| `fel-tool-factory-repository` | 工具工厂仓库 | -| `fel-tool-repository-simple` | 工具仓库(简单实现) | +| 插件名称 | 说明 | +|------------------------------|------------| +| `fel-tool-repository-simple` | 工具仓库(简单实现) | -**FIT 内置插件**: Level 4 还包含 20 个 FIT 框架内置插件(category=SYSTEM),提供 HTTP 服务、序列化、验证、服务发现等核心功能。详见 `framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md` - -**启动时机**: 第一批启动,提供基础工具仓库能力。 +**FIT 内置插件**: Level 4 还包含 20 个 FIT 框架内置插件(category=SYSTEM),提供 HTTP 服务、序列化、验证、服务发现等核心功能。详见 +`framework/fit/java/fit-builtin/plugins/FIT插件启动顺序说明.md` --- -#### category=SYSTEM, level=5 (4个) - -| 插件名称 | 说明 | -|-----------------------|---------| -| `fel-tool-discoverer` | 工具发现器 | -| `fel-tool-executor` | 工具执行器 | -| `fel-tool-mcp-client` | MCP 客户端 | -| `fel-tool-mcp-server` | MCP 服务端 | +#### category=SYSTEM, level=5 (5个) -**启动时机**: Level 4 的工具仓库加载完成后启动。这些插件依赖 Level 4 的 `fel-tool-repository-simple` 和 `fel-tool-factory-repository`,提供工具发现、执行和 MCP 协议支持。 +| 插件名称 | 说明 | +|-------------------------------|---------| +| `fel-tool-discoverer` | 工具发现器 | +| `fel-tool-executor` | 工具执行器 | +| `fel-tool-factory-repository` | 工具工厂仓库 | +| `fel-tool-mcp-client` | MCP 客户端 | +| `fel-tool-mcp-server` | MCP 服务端 | --- @@ -87,8 +99,6 @@ |---------------------------|-------------| | `fel-model-openai-plugin` | OpenAI 模型集成 | -**启动时机**: 所有 SYSTEM 插件中最后启动,确保基础设施和工具链完全就绪。 - --- ### 阶段2: USER 插件 @@ -99,14 +109,10 @@ |------------------------------|-----------| | `fel-tokenizer-hanlp-plugin` | HanLP 分词器 | -**启动时机**: 所有 SYSTEM 插件启动完成后,USER 插件中最先加载,提供基础分词功能。 - --- #### category=USER, level=4 (1个) | 插件名称 | 说明 | |--------------------------|-----------------| -| `fel-langchain-runnable` | LangChain 运行时支持 | - -**启动时机**: USER 插件中 Level 1 启动完成后加载。 \ No newline at end of file +| `fel-langchain-runnable` | LangChain 运行时支持 | \ No newline at end of file diff --git a/framework/fel/java/plugins/tool-factory-repository/pom.xml b/framework/fel/java/plugins/tool-factory-repository/pom.xml index 4edc7165..fb2e62fa 100644 --- a/framework/fel/java/plugins/tool-factory-repository/pom.xml +++ b/framework/fel/java/plugins/tool-factory-repository/pom.xml @@ -39,7 +39,7 @@ ${fit.version} system - 4 + 5 diff --git "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" index 0e1620bd..44eb1b81 100644 --- "a/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" +++ "b/framework/fit/java/fit-builtin/plugins/FIT\346\217\222\344\273\266\345\220\257\345\212\250\351\241\272\345\272\217\350\257\264\346\230\216.md" @@ -20,26 +20,13 @@ FIT 框架插件启动顺序 │ ├─ 阶段1: SYSTEM 插件启动 │ │ -│ ├─ Level 4 (22个) -│ │ ├─ FIT 内置插件(20个) -│ │ └─ FEL 工具仓库(2个) -│ │ -│ ├─ Level 5 (4个) -│ │ └─ FEL 工具链(fel-tool-discoverer等) -│ │ -│ └─ Level 7 (1个) -│ └─ FEL 模型集成(fel-model-openai-plugin) +│ └─ Level 4 (20个自动输出 + 2个可选) +│ └─ FIT 内置插件 │ └─ 阶段2: USER 插件启动 - │ - ├─ Level 1 (1个) - │ └─ FEL 用户插件(fel-tokenizer-hanlp-plugin) - │ - └─ Level 4 (1个) - └─ FEL 用户插件(fel-langchain-runnable) ``` -**FIT 内置插件在 SYSTEM Level 4,与 FEL 工具仓库插件一起,是所有插件中最先启动的一批。** +**FIT 内置插件均配置为 SYSTEM Level 4,为应用层插件提供基础服务。** ### 启动规则 @@ -47,6 +34,10 @@ FIT 框架插件启动顺序 - **相同 category 内,level 数值越小,启动优先级越高** - **相同 category 和 level 的插件,加载顺序不确定** +**默认值**: +- 未指定 category 时,默认为 **category=USER** +- 未指定 level 时,默认为 **level=4** + --- ## 自动添加的FIT插件