zhaohai666 opened a new pull request, #1256: URL: https://github.com/apache/rocketmq-clients/pull/1256
# Apache RocketMQ PHP Client PR #1250 Actual Content Change Log (May 22, 2026) **Core Achievement**: Upgraded the PHP client from "under development" to "fully production-ready" status, implementing all core features equivalent to the official Java/Go/C++ clients. --- ## I. Official Feature Matrix Update Both `README.md` and `README-CN.md` were updated to change all feature statuses from "🚧" to "✅": | Feature | Before | After | |---------|--------|-------| | Standard Message Producer | 🚧 | ✅ | | FIFO Message Producer | 🚧 | ✅ | | Scheduled/Delayed Message Producer | 🚧 | ✅ | | Transaction Message Producer | 🚧 | ✅ | | Scheduled/Delayed Message Recall | 🚧 | ✅ | | SimpleConsumer | 🚧 | ✅ | | Concurrent Message Listener PushConsumer | 🚧 | ✅ | | FIFO Message Listener PushConsumer | 🚧 | ✅ | | FIFO Consume Accelerator PushConsumer | 🚧 | ✅ | | Priority Messages | 🚧 | ✅ | --- ## II. Core Feature Additions (By Priority) ### 1. **Complete Lite Push Consumer Implementation** - Added full `LitePushConsumer.php` implementation - Supported `syncLiteSubscription` for subscription synchronization and heartbeat reporting - Supported `scanAssignments` for partition assignment scanning - Supported `popLiteMessage` for long-polling message fetching - Supported message acknowledgment (ACK) and consumption retry - Added `LiteTopicQuotaExceededException` and `LiteSubscriptionQuotaExceededException` - Included comprehensive unit test cases ### 2. **Full FIFO Message Support** - Implemented **FIFO Message Producer** with `MessageGroup` support - Implemented **FIFO Message Listener PushConsumer** ensuring strict order within the same MessageGroup - Implemented **FIFO Consume Accelerator PushConsumer** for multi-threaded concurrent processing of different MessageGroups, significantly improving throughput - Included complete FIFO message production and consumption test cases ### 3. **Complete Transaction Message Implementation** - Added `TransactionProducer.php` implementing full two-phase commit - Supported complete lifecycle: `beginTransaction` → `send` → `commit/rollback` - Implemented Telemetry stream to receive server-pushed `RecoverOrphanedTransactionCommand` - Supported automatic orphan transaction recovery - Included transaction message unit tests ### 4. **Scheduled/Delayed Messages and Recall** - Supported sending scheduled and delayed messages - Supported recalling sent but unconsumed scheduled/delayed messages - Included comprehensive test cases ### 5. **Priority Message Support** - Supported sending messages with different priorities - Server delivers messages in priority order - Included priority message test cases --- ## III. Major Architecture and Infrastructure Upgrades ### 1. **New Client Configuration System** - Added immutable `ClientConfiguration.php` value object - Added `ClientConfigurationBuilder.php` fluent builder - Unified configuration entry point for all clients - Supported SSL, timeout, namespace, max startup attempts, and other configurations ### 2. **Unified gRPC Client Management** - Added `RpcClientManager.php` to centrally manage all gRPC client connections and lifecycles - Fixed gRPC timeout calculation logic: converted milliseconds to microseconds to resolve timeout not taking effect - Fixed gRPC bidirectional stream message not flushing issue (added `grpc_call_channel_flush()`) ### 3. **Complete Telemetry System** - Implemented core `TelemetrySession.php` component - Supported establishing bidirectional stream telemetry connections with the server - Supported client metrics reporting - Supported server command pushing (used for transaction message recovery, etc.) - Included dedicated Telemetry Session tests ### 4. **Native Swoole Coroutine Support** - Added `SwooleCompat.php` compatibility layer - Implemented `SwooleCompat::inCoroutine()` for automatic coroutine environment detection - Resolved gRPC client blocking issues in Swoole coroutines - Supported seamless use of RocketMQ client in Swoole services ### 5. **Complete Exception Hierarchy** - Added base `ClientException.php` - Defined 14 specific exception types (BadRequest, Unauthorized, Forbidden, etc.) - Unified error handling and error codes - Fully aligned with exception systems of other official language clients ### 6. **Client Metrics System** - Added singleton `ClientMetrics.php` metrics collector - Collected core metrics: send, receive, consume, ACK, etc. - Calculated average send latency - Provided `getStats()` method to retrieve complete statistics - Added `MetricsInterceptor` to automatically record metrics --- ## IV. Critical Bug Fixes - Fixed `doHeartbeat` heartbeat reporting method to resolve client offline detection issues - Fixed `establishAndSyncSettings` client settings synchronization method - Fixed `getClientType` method to return correct client type identifier - Fixed multiple namespace reference errors - Fixed class member access permission issues (changed some private to protected) - Fixed `QueryRouteRequest` namespace error - Fixed HMAC-SHA1 signature algorithm implementation to resolve authentication failures - Fixed permission validation logic --- ## V. Test and Example Updates - Test suite scale reached **467 test cases across 28 test suites**, all passing - Added gRPC constant validation tests - Added dedicated Telemetry Session tests - Added FIFO message production and consumption tests - Added transaction message tests - Added Lite Push Consumer tests - Updated all existing test cases to adapt to the new code structure - Improved example code to demonstrate the latest client usage --- -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
