承接 pdezwart/php-amqp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pdezwart/php-amqp

Composer 安装命令:

pie install pdezwart/php-amqp

包简介

PHP AMQP Binding Library

README 文档

README

Object-oriented PHP bindings for the AMQP C library (https://github.com/alanxz/rabbitmq-c)

Requirements:

  • PHP >= 7.4 with either ZTS or non-ZTS version.
  • Starting with php-amqp 2.0.0 at least version 0.8.0 of librabbitmq is required (at least 0.10.0 is recommended)
  • to run tests RabbitMQ server >= 3.4.0 required.

Installation

Linux

Some systems have php-amqp extension available in their package repositories or available via an external repository so it is MAY be the preferable way to install.

Fresh php-pecl-amqp and librabbitmq RPMs available via remi repo.

If you want to stay on the bleeding edge and have the latest version, install php-amqp extension from PECL or compile from sources (follow PHP official docs instruction).

Windows

  • Before download, check if your PHP installation is thread safe or non-thread safe by entering php -i|findstr " Thread" in your terminal
  • Download thread safe or non-thread safe version of the extension for your PHP version from https://pecl.php.net/package/amqp. Look for the "DLL" link next to each release in the list of available releases
  • After download, copy the rabbitmq.4.dll and rabbitmq.4.pdb files to the PHP root folder and copy php_amqp.dll and php_amqp.pdb files to PHP\ext folder
  • Add extension=amqp to the php.ini file
  • Check if the module is properly installed with php -m

Documentation

Check out the official RabbitMQ tutorials as well as the php-amqp specific examples.

There are also stub files available that document the API of PHP AMQP. These stubs can also be used in your IDE for code completion, navigation and documentation.

Check out the upgrading guide to check breaking changes between versions, e.g. from 1.x to 2.x.

Finally, check out the tests to see usage examples and edge cases.

Notes & limitations

  • You can't share any of AMQP API objects (AMQPConnection, AMQPChannel, AMQPQueue, AMQPExchange) between threads. Use a separate connection per thread.
  • There may only be one persistent connection per connection information. If there will be an attempt to create another persistent connection with the same credentials, an exception will be thrown.
  • Channels on persistent connections are not persistent: they are destroyed between requests.
  • Heartbeats are limited to blocking calls only, so if there are no any operations on a connection or no active consumer set, connection may be closed by the broker as dead.

Related libraries

How to report a problem

  1. First, search through the closed issues and stackoverflow.com.
  2. Submit an issue with short and definitive title that describe your problem
  3. Provide platform info, PHP interpreter version, SAPI mode (cli, fpm, cgi, etc) the extension is used in, php-amqp extension version, librabbitmq version, make tools version.
  4. Description should provide information on how to reproduce a problem (gist is the most preferable way to include large sources) in a definitive way. Use Vagrant to replicate unusual environments.
  5. If stack trace is generated, include it in full via gist or the important part (if you definitely know what you are doing) directly in the description.

Things to check before reporting a problem

Some of them, the list is not complete.

  1. You are running on correct machine in correct environment and your platform meets your application requirement.
  2. librabbitmq is installed and discoverable in your environment so php-amqp extension can load it.
  3. php-amqp extension present in system (find amqp.so or amqp.dll if you are on windows), it is loaded (php --ri amqp produced some info), and there are no underlying abstraction that MAY emulate php-amqp work.
  4. You hav correct RabbitMQ credentials.
  5. You are using the latest php-amqp, librabbitmq, RabbitMQ and sometimes PHP version itself. Sometimes your problem is already solved.
  6. Other extensions disabled (especially useful when PHP interpreter crashes, and you get a stack trace and segmentation fault).

Development

See DEVELOPMENT.md for details.

pdezwart/php-amqp 适用场景与选型建议

pdezwart/php-amqp 是一款 基于 C 开发的 Composer 扩展包,目前已累计 246.24k 次下载、GitHub Stars 达 585, 最近一次更新时间为 2014 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「queue」 「rabbitmq」 「message」 「AMQP」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 pdezwart/php-amqp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 pdezwart/php-amqp 我们能提供哪些服务?
定制开发 / 二次开发

基于 pdezwart/php-amqp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 246.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 585
  • 点击次数: 21
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 585
  • Watchers: 31
  • Forks: 122
  • 开发语言: C

其他信息

  • 授权协议: PHP-3.01
  • 更新时间: 2014-08-21