Repository navigation
feat: 新增 FastD 微服务集成包 - #1
Merged
Merged
Conversation
- etcd v3 HTTP gateway 客户端 - 服务注册、解析与负载均衡 - etcd 配置源 - 按服务名解析的 PSR-18 客户端 - W3C traceparent 传播 - 重试、熔断、进程内限流 - 单元测试与 CI
- IntegrationsServiceProvider 读取 config/integrations.php - 注册 etcd、服务发现、服务客户端、配置源 - 按配置装配 tracing、retry、circuit breaker、rate limit - 增加示例配置与 Provider 测试 - README 补充安装、配置、注册、调用、治理和限流示例
- tracing 与 rate limit 不再依赖 etcd 配置 - 补充 Provider 测试与示例配置说明
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概述
新增
fastd/integrations微服务集成包,提供 etcd 服务发现、配置源、服务客户端、W3C 链路传播和客户端治理能力。模块
Etcd
EtcdClient:etcd v3 HTTP gateway 客户端Discovery
EtcdServiceRegistry:服务注册、心跳、注销EtcdResolver:按服务前缀解析实例,短 TTL 缓存Config
EtcdConfigSource:把 etcd 层级 key 转换为嵌套数组HttpClient
ServiceClient:使用请求 URI host 作为服务名,解析实例并替换目标地址Tracing
TraceContext:W3C traceparent 生成/解析TracingMiddleware:入口提取/生成 trace contextTraceClient:向下游注入 traceparentGovernance
RetryClient/RetryPolicy:仅对幂等方法重试CircuitBreaker/CircuitBreakerClient:closed/open/half-openInMemoryRateLimiter/RateLimitMiddleware:进程内令牌桶ServiceProvider
IntegrationsServiceProvider读取config/integrations.php并装配:integrations.etcdintegrations.discovery.resolverintegrations.discovery.registryintegrations.http.service_clientintegrations.config.sourceintegrations.tracing.middlewareintegrations.governance.rate_limiterintegrations.governance.rate_limit_middlewareintegrations.service_instancematcher存在时自动挂载 tracing 与 rate limit 中间件。设计边界
验收
README 覆盖安装、FastD 配置、ServiceProvider 注册、服务注册、服务调用、配置中心、链路、重试、熔断和限流示例。