ghf / aliyun-mq-http-sdk
Aliyun Message Queue(MQ) Http PHP SDK, PHP>=8.4
1.0.0
2026-10-27 03:09 UTC
Requires
- php: >=8.4
- ext-dom: *
- ext-xmlreader: *
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 03:11:34 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>=8.4, and ext-dom / ext-xmlreader extensions of php are required.
PHP 8.4+ 改版说明(breaking changes)
相对官方 aliyunmq/mq-http-sdk 1.0.4,本版本为支持 PHP 8.4/8.5 做了以下不兼容调整:
- 生产者/消费者构造函数参数顺序调整(可选参数
$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 约束升级为
^7.9;HttpClient构造选项不再使用 Guzzle 5 的defaults包装。 - 全部隐式可空参数改为显式
?Type,修复 PHP 8.4 弃用告警;MQException对$code做了 int 归一化。
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.