Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
5c842d2
Regenerate gRPC code with PHP language constant support
zhaohai666 May 7, 2026
f68d869
Add test for gRPC constants verification
zhaohai666 May 7, 2026
ed4516d
Add test for gRPC 1.80.2dev Telemetry Session
zhaohai666 May 7, 2026
75618a6
fix grpc
zhaohai666 May 18, 2026
3dd673a
fix TelemetrySession.php
zhaohai666 May 18, 2026
a1ed93e
update php
zhaohai666 May 19, 2026
04ef72a
Merge branch 'master' into Update_PHP_client_features_local
zhaohai666 May 19, 2026
f1304b2
add SessionCredentials
zhaohai666 May 19, 2026
d908f24
update annotation
zhaohai666 May 19, 2026
84a0a3b
fix Permission
zhaohai666 May 19, 2026
6d97a2c
fix QueryRouteRequest namespace
zhaohai666 May 19, 2026
ce101dd
add RpcClientManager
zhaohai666 May 19, 2026
b358c55
add RpcClientManager
zhaohai666 May 19, 2026
ae0950a
add RpcClientManager
zhaohai666 May 19, 2026
e25edcb
add SwooleCompat
zhaohai666 May 20, 2026
7afd91f
update SimpleConsumer.php
zhaohai666 May 20, 2026
859cbac
add PublishingLoadBalancer
zhaohai666 May 20, 2026
23f401c
add PublishingLoadBalancer
zhaohai666 May 20, 2026
c780cbf
fix grpcTimeoutMicroseconds
zhaohai666 May 20, 2026
8f8c896
fix establishAndSyncSettings
zhaohai666 May 20, 2026
76c9193
fix SwooleCompat::inCoroutine
zhaohai666 May 20, 2026
e58f229
fix grpc-timeout
zhaohai666 May 20, 2026
414f3c4
fix grpc-timeout
zhaohai666 May 20, 2026
1c3a9f9
fix grpc-timeout
zhaohai666 May 20, 2026
18294e4
fix namespace
zhaohai666 May 21, 2026
5425fc3
fix hmacSha1
zhaohai666 May 21, 2026
a705309
Merge branch 'master' into Update_PHP_client_features_local
zhaohai666 May 21, 2026
300cb24
fix doHeartbeat
zhaohai666 May 21, 2026
43d9d70
fix lite push consumer
zhaohai666 May 21, 2026
6e0ecf7
fix protected
zhaohai666 May 21, 2026
e742911
fix getClientType
zhaohai666 May 21, 2026
59b1260
fix start
zhaohai666 May 21, 2026
d33a522
fix lite ack
zhaohai666 May 22, 2026
220a89a
update example
zhaohai666 May 22, 2026
a674c03
update test
zhaohai666 May 22, 2026
355088d
update composer.json
zhaohai666 May 22, 2026
6ea0fe3
fix Heartbeat
zhaohai666 May 22, 2026
2702af8
fix extractTopic
zhaohai666 May 25, 2026
25ba756
fix extractTopic
zhaohai666 May 25, 2026
961d463
fix extractTopic
zhaohai666 May 25, 2026
c44d64d
fix refreshRouteCache
zhaohai666 May 25, 2026
a1f3635
add executeNackInterceptor
zhaohai666 May 25, 2026
7937b6b
fix extractTopic
zhaohai666 May 25, 2026
4234567
fix wrapHeartbeatRequest
zhaohai666 May 26, 2026
42eca3d
fix fetchMessages
zhaohai666 May 26, 2026
28609b9
fix retry
zhaohai666 May 26, 2026
0241b3c
fix scanAssignments
zhaohai666 May 26, 2026
a354703
fix createStreamAndSync
zhaohai666 May 26, 2026
4007a6e
fix test
zhaohai666 May 27, 2026
003d2c3
add tls
zhaohai666 May 27, 2026
7ccc890
fix aLo
zhaohai666 May 27, 2026
2d00683
fix aLo
zhaohai666 May 27, 2026
fa60bd9
remove lite simple
zhaohai666 May 27, 2026
f28b0a0
fix getCallOptions
zhaohai666 May 28, 2026
0cd8113
fix getCallOptions
zhaohai666 May 28, 2026
fd66ba0
fix test
zhaohai666 May 28, 2026
5bce404
remove code
zhaohai666 May 28, 2026
a05bcaa
fix usleep
zhaohai666 May 28, 2026
5a546aa
fix test
zhaohai666 May 28, 2026
5239f5b
fix producer
zhaohai666 May 28, 2026
6a636ca
Merge remote-tracking branch 'origin/Update_PHP_client_features_local…
zhaohai666 May 28, 2026
2630185
remove code
zhaohai666 May 28, 2026
49f0977
fix usleep
zhaohai666 May 28, 2026
80e7a5a
fix snapshot shard state ti prevent race condition in swoole coroutin…
zhaohai666 May 29, 2026
1193c8a
fix test
zhaohai666 May 29, 2026
e05322b
fix instanceTimestamps
zhaohai666 May 29, 2026
a36a91e
docs: add design spec for PHP integration tests and gRPC mock framework
zhaohai666 May 29, 2026
64d350d
docs: add implementation plan for PHP integration tests and gRPC mock…
zhaohai666 May 29, 2026
3cfba0b
feat: add mock registry to RpcClientManager for gRPC integration testing
zhaohai666 May 29, 2026
85d9a09
feat: add GrpcMockHelper for creating gRPC call mocks
zhaohai666 May 29, 2026
0f219a1
feat: add IntegrationTestCase base class with singleton cleanup
zhaohai666 May 29, 2026
5631e09
feat: add integration test suite to phpunit.xml
zhaohai666 May 29, 2026
fe07ca4
fix protobuf version
zhaohai666 May 29, 2026
0a38035
test: add RpcClientManager mock registry integration tests
zhaohai666 May 29, 2026
ea76b58
test: add SimpleConsumer integration tests and fix related bugs
zhaohai666 May 29, 2026
41344cc
fix executeDLQInterceptor
zhaohai666 May 29, 2026
b34dc1e
test: add Producer integration tests with gRPC mocks
zhaohai666 May 29, 2026
7e39927
test: add heartbeat, load balancer, and retry error integration tests
zhaohai666 May 29, 2026
4d68251
docs: fix PHPDoc inaccuracies across all modified PHP files
zhaohai666 May 29, 2026
b21a701
test: add PushConsumer, ProcessQueue, Transaction, and TelemetrySessi…
zhaohai666 May 29, 2026
baaa8ae
docs: add comprehensive PHPDoc to all methods across entire PHP codebase
zhaohai666 May 29, 2026
5e6e067
fix test
zhaohai666 May 29, 2026
24d7158
fix test
zhaohai666 May 29, 2026
8b70a16
add gRPC mocks
zhaohai666 May 29, 2026
cd8ebd0
update awaitDuration
zhaohai666 May 29, 2026
716c897
fix deadline
zhaohai666 May 29, 2026
c19e53f
update example
zhaohai666 Jun 1, 2026
d83b715
update grpc-timeout
zhaohai666 Jun 1, 2026
e0f4761
update SwooleCompat.php
zhaohai666 Jun 2, 2026
0aab85f
update receiveFromAllQueues
zhaohai666 Jun 2, 2026
a8eeb3c
feat: add graceful shutdown to consumer examples and modernize with P…
zhaohai666 Jun 2, 2026
b4391a2
fix test
zhaohai666 Jun 2, 2026
b59465a
update match
zhaohai666 Jun 2, 2026
d4f2738
refactor: extract PublishingRouteManager from Producer, decouple Hear…
zhaohai666 Jun 2, 2026
4f8e078
fix protected
zhaohai666 Jun 2, 2026
58f6a14
update php version
zhaohai666 Jun 2, 2026
2c27eb4
update warning
zhaohai666 Jun 2, 2026
0ca264d
update name
zhaohai666 Jun 2, 2026
6ed96c3
fix workflow test
zhaohai666 Jun 3, 2026
55cbc79
fix Logger.php
zhaohai666 Jun 3, 2026
7873f91
fix beStrictAboutOutputDuringTests
zhaohai666 Jun 3, 2026
36a93aa
fix: suppress gRPC C-core stderr noise in CI test runs via bootstrap
zhaohai666 Jun 3, 2026
b87e854
ci: set GRPC_VERBOSITY at OS level in PHP build workflow
zhaohai666 Jun 3, 2026
d49a2bf
feat: support sslEnabled toggle to disable TLS for dev/CI environments
zhaohai666 Jun 3, 2026
ddabd44
add ssl enable
zhaohai666 Jun 3, 2026
6161288
fix log
zhaohai666 Jun 3, 2026
05df586
fix: update getChannelArgs to accept targetHost, fix GRPC_TRACE value
zhaohai666 Jun 3, 2026
b18cac1
fix windows
zhaohai666 Jun 3, 2026
235cb4c
fix test
zhaohai666 Jun 3, 2026
191f33c
fix test
zhaohai666 Jun 3, 2026
6c97826
add test
zhaohai666 Jun 4, 2026
d40a718
add interface
zhaohai666 Jun 4, 2026
b8de247
remove method_exists
zhaohai666 Jun 4, 2026
850d9db
remove method_exists
zhaohai666 Jun 4, 2026
dc2c9b7
remove method_exists
zhaohai666 Jun 4, 2026
20db93f
remove lock
zhaohai666 Jun 5, 2026
367f6e7
update doc
zhaohai666 Jun 5, 2026
6efe46d
Optimization type
zhaohai666 Jun 5, 2026
49056ec
Delete unused dependencies
zhaohai666 Jun 8, 2026
649eea4
Fix compatibility and loose comparison
zhaohai666 Jun 8, 2026
cc6d57d
Fix inheritance compatibility
zhaohai666 Jun 8, 2026
a5a2862
Fix inheritance compatibility
zhaohai666 Jun 8, 2026
3e9b5c0
Fix TypeError
zhaohai666 Jun 8, 2026
f05b930
Fix TypeError
zhaohai666 Jun 8, 2026
04f57e6
Fix TypeError
zhaohai666 Jun 8, 2026
14581f6
Fix $parsedEndpoints
zhaohai666 Jun 8, 2026
533ffdc
add getMessageBrokerKey
zhaohai666 Jun 9, 2026
18593b4
update php doc
zhaohai666 Jun 10, 2026
5cc3f6d
update php doc
zhaohai666 Jun 10, 2026
15da757
remove require_once
zhaohai666 Jun 10, 2026
df9bb4f
fix test
zhaohai666 Jun 10, 2026
3017d33
fix test
zhaohai666 Jun 10, 2026
895e95c
remove doc
zhaohai666 Jun 11, 2026
bcca7df
Merge branch 'master' into Update_PHP_client_features_local
zhaohai666 Jun 30, 2026
624845d
fix LiteTopicQuotaExceededException
zhaohai666 Jun 30, 2026
3576eda
fix waitForSettingsConfirmation
zhaohai666 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codespell_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- name: Run CodeSpell
run: |
codespell --quiet-level=2 \
--skip "./cpp/third_party,./style/codespell/ignore_words.txt,./.git" \
--skip "./cpp/third_party,./php/vendor,./nodejs/node_modules,./style/codespell/ignore_words.txt,./.git" \
--ignore-words ./style/codespell/ignore_words.txt \
--exclude-file ./style/codespell/exclude_file.txt \
27 changes: 25 additions & 2 deletions .github/workflows/php_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ["7.4", "8.0", "8.1"]
php-version: ["8.1", "8.2", "8.3"]
os: [ ubuntu-22.04, macos-11, windows-2022 ]
steps:
- name: Checkout
Expand All @@ -17,9 +17,32 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: grpc, protobuf
- name: Validate composer.json
working-directory: ./php
run: composer validate
- name: Install Dependencies
working-directory: ./php
run: composer install
run: composer install --no-interaction --prefer-dist
- name: Run PHPUnit Tests
if: runner.os != 'Windows'
working-directory: ./php
run: vendor/bin/phpunit --testsuite "RocketMQ PHP Test Suite" --no-coverage
- name: Run PHPUnit Tests (Windows)
if: runner.os == 'Windows'
working-directory: ./php
shell: bash
# Workaround: gRPC C extension may cause non-zero exit during PHP shutdown on
# Windows even when all tests pass. Only suppress the exit code when PHPUnit
# reports success (OK) but the process exits non-zero due to the gRPC issue.
run: |
set +e
vendor/bin/phpunit --testsuite "RocketMQ PHP Test Suite" --no-coverage > phpunit_output.txt 2>&1
exit_code=$?
set -e
cat phpunit_output.txt
if [ "$exit_code" -ne 0 ] && grep -qE 'OK \([0-9]+ tests?' phpunit_output.txt; then
echo "::warning::PHPUnit reported success but process exited with code $exit_code - likely gRPC shutdown issue on Windows"
exit 0
fi
exit "$exit_code"
20 changes: 10 additions & 10 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

| η‰Ήζ€§ | Java | C/C++ | C# | Golang | Rust | Python | Node.js | PHP |
|------------------------------------------------| :---: |:------:|:-----:|:------:|:----:|:------:|:-------:| :---: |
| Producer with standard messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with FIFO messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with transactional messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with recalling timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Simple consumer | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with concurrent message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with FIFO message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with FIFO consume accelerator | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Priority Message | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with standard messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with FIFO messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with transactional messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with recalling timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Simple consumer | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with concurrent message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with FIFO message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with FIFO consume accelerator | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Priority Message | βœ… | 🚧 | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |

## ε…ˆε†³ζ‘δ»Άε’Œζž„ε»Ί

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Provide cloud-native and robust solutions for Java, C++, C#, Golang, Rust and al

| Feature | Java | C/C++ | C# | Golang | Rust | Python | Node.js | PHP |
| ---------------------------------------------- | :---: | :---: | :---: | :----: | :---: | :----: | :-----: | :---: |
| Producer with standard messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with FIFO messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with transactional messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with recalling timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Simple consumer | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with concurrent message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with FIFO message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Push consumer with FIFO consume accelerator | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Priority Message | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | 🚧 |
| Producer with standard messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with FIFO messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with transactional messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Producer with recalling timed/delay messages | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Simple consumer | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with concurrent message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with FIFO message listener | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Push consumer with FIFO consume accelerator | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |
| Priority Message | βœ… | 🚧 | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… |

## Prerequisite and Build

Expand Down
3 changes: 3 additions & 0 deletions php/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
src
vendor
composer.lock
coverage
.phpunit.result.cache
phpunit.xsd
168 changes: 168 additions & 0 deletions php/ClientConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?php
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Apache\Rocketmq;

/**
* ClientConfiguration - Immutable configuration value object.
* Created exclusively by ClientConfigurationBuilder::build().
* Referencing Java ClientConfiguration.java
*/
class ClientConfiguration
{
private readonly string $endpoints;
private readonly ?SessionCredentials $sessionCredentialsProvider;
private readonly int $requestTimeoutMs;
private readonly bool $sslEnabled;
private readonly string $namespace;
private readonly int $maxStartupAttempts;
private readonly ?TlsCredentials $tlsCredentials;

/**
* Private constructor - instantiated only via ClientConfiguration::create().
*
* @param string $endpoints Target endpoint addresses.
* @param SessionCredentials|null $sessionCredentialsProvider Session credentials provider for authentication.
* @param int $requestTimeoutMs RPC request timeout in milliseconds.
* @param bool $sslEnabled Whether SSL is enabled.
* @param string $namespace Namespace for the client.
* @param int $maxStartupAttempts Maximum number of startup retry attempts.
* @param TlsCredentials|null $tlsCredentials TLS credentials for secure connections.
*/
private function __construct(
string $endpoints,
?SessionCredentials $sessionCredentialsProvider,
int $requestTimeoutMs,
bool $sslEnabled,
string $namespace,
int $maxStartupAttempts,
?TlsCredentials $tlsCredentials = null
) {
$this->endpoints = $endpoints;
$this->sessionCredentialsProvider = $sessionCredentialsProvider;
$this->requestTimeoutMs = $requestTimeoutMs;
$this->sslEnabled = $sslEnabled;
$this->namespace = $namespace;
$this->maxStartupAttempts = $maxStartupAttempts;
$this->tlsCredentials = $tlsCredentials;
}

/**
* Factory method - only callable from ClientConfigurationBuilder.
*
* @param string $endpoints Target endpoint addresses.
* @param SessionCredentials|null $sessionCredentialsProvider Session credentials provider for authentication.
* @param int $requestTimeoutMs RPC request timeout in milliseconds.
* @param bool $sslEnabled Whether SSL is enabled.
* @param string $namespace Namespace for the client.
* @param int $maxStartupAttempts Maximum number of startup retry attempts.
* @param TlsCredentials|null $tlsCredentials TLS credentials for secure connections.
* @return ClientConfiguration New immutable configuration instance.
*
* @internal
*/
public static function create(
string $endpoints,
?SessionCredentials $sessionCredentialsProvider,
int $requestTimeoutMs,
bool $sslEnabled,
string $namespace,
int $maxStartupAttempts,
?TlsCredentials $tlsCredentials = null
): ClientConfiguration {
return new self(
$endpoints,
$sessionCredentialsProvider,
$requestTimeoutMs,
$sslEnabled,
$namespace,
$maxStartupAttempts,
$tlsCredentials
);
}

/**
* Get the target endpoints address.
*
* @return string Target endpoint addresses.
*/
public function getEndpoints(): string
{
return $this->endpoints;
}

/**
* Get the session credentials provider.
*
* @return SessionCredentials|null Session credentials provider, or null if not set.
*/
public function getSessionCredentialsProvider(): ?SessionCredentials
{
return $this->sessionCredentialsProvider;
}

/**
* Get the RPC request timeout in milliseconds.
*
* @return int RPC request timeout in milliseconds.
*/
public function getRequestTimeoutMs(): int
{
return $this->requestTimeoutMs;
}

/**
* Check whether SSL is enabled.
*
* @return bool True if SSL is enabled, false otherwise.
*/
public function isSslEnabled(): bool
{
return $this->sslEnabled;
}

/**
* Get the namespace.
*
* @return string Namespace for the client.
*/
public function getNamespace(): string
{
return $this->namespace;
}

/**
* Get the maximum number of startup retry attempts.
*
* @return int Maximum number of startup retry attempts.
*/
public function getMaxStartupAttempts(): int
{
return $this->maxStartupAttempts;
}

/**
* Get the TLS credentials for gRPC connections.
*
* @return TlsCredentials|null TLS credentials, or null if not set.
*/
public function getTlsCredentials(): ?TlsCredentials
{
return $this->tlsCredentials;
}
}
Loading
Loading