ghf / aliyun-mq-http-sdk
Aliyun Message Queue(MQ) Http PHP SDK, PHP>=7.2.5
1.0.1
2026-11-19 09:43 UTC
Requires
- php: >=7.2.5
- ext-dom: *
- ext-xmlreader: *
- guzzlehttp/guzzle: ^6.5 || ^7.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-19 09:45:23 UTC
README
Alyun MQ Documents: http://www.aliyun.com/product/ons
Aliyun MQ Console: https://ons.console.aliyun.com
Intall Composer
To install composer by following commands, or see composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Install & Use
Add require to your composer.json
{
"require": {
"aliyunmq/mq-http-sdk": ">=1.0.4"
}
}
Use Composer to install requires
composer install
Note: php version>=7.2.5(支持 PHP 7.2 至 PHP 8.),and ext-dom / ext-xmlreader extensions of php are required.*
PHP 7.2+ / 8.* 改版说明(breaking changes)
相对官方 aliyunmq/mq-http-sdk 1.0.4,本版本为兼容 PHP 7.2~8.* 做了以下不兼容调整:
- 生产者/消费者构造函数参数顺序调整(可选参数
$instanceId移到末尾):MQProducer(HttpClient $client, $topicName, $instanceId = null)MQTransProducer(HttpClient $client, $topicName, $groupId, $instanceId = null)MQConsumer(HttpClient $client, $topicName, $consumer, $messageTag = null, $instanceId = null)- 通过
MQClient::getProducer()/getConsumer()/getTransProducer()调用的代码无需修改。
- Guzzle 约束为
^6.5 || ^7.0;HttpClient构造选项不再使用 Guzzle 5 的defaults包装。 - 全部隐式可空参数改为显式
?Type,修复 PHP 8.4 弃用告警;MQException对$code做了 int 归一化。 - 发往 Guzzle 的请求头统一转为 string,避免 psr7 2.11+ 的 “Passing int to ...Request::__construct()” 弃用告警(psr7 3.0 将直接拒绝)。
Note
- Http consumer only support timer msg (less than 3 days), no matter the msg is produced from http or tcp protocol.
- Order is only supported at special server cluster.