AMQP,即Advanced Message Queuing Protocol,一个提供统一消息服务的应用层标准高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计。基于此协议的客户端与消息中间件可传递消息,并不受客户端/中间件不同产品,不同的开发语言等条件的限制。Erlang中的实现有 RabbitMQ等。
abstract class AbstractChannel { const PROTOCOL_080 = '0.8'; const PROTOCOL_091 = '0.9.1'; public static $PROTOCOL_CONSTANTS_CLASS; public function __construct(AbstractConnection $connection, $channel_id) { $this->connection = $connection; $this->channel_id = $channel_id; $connection->channels[$channel_id] = $this; $this->frame_queue = array(); // Lower level queue for frames $this->method_queue = array(); // Higher level queue for methods $this->auto_decode = false; $this->msg_property_reader = new AMQPReader(null); $this->wait_content_reader = new AMQPReader(null); $this->dispatch_reader = new AMQPReader(null); $this->protocolVersion = self::getProtocolVersion(); switch ($this->protocolVersion) { case self::PROTOCOL_091: self::$PROTOCOL_CONSTANTS_CLASS = 'PhpAmqpLib\Wire\Constants091'; $c = self::$PROTOCOL_CONSTANTS_CLASS; $this->debug = new DebugHelper($c); $this->amqp_protocol_header = $c::$AMQP_PROTOCOL_HEADER; $this->protocolWriter = new Protocol091(); $this->waitHelper = new Wait091(); $this->methodMap = new MethodMap091(); break; case self::PROTOCOL_080: self::$PROTOCOL_CONSTANTS_CLASS = 'PhpAmqpLib\Wire\Constants080'; $c = self::$PROTOCOL_CONSTANTS_CLASS; $this->debug = new DebugHelper($c); $this->amqp_protocol_header = $c::$AMQP_PROTOCOL_HEADER; $this->protocolWriter = new Protocol080(); $this->waitHelper = new Wait080(); $this->methodMap = new MethodMap080(); break; default: throw new AMQPRuntimeException(sprintf( 'Protocol: %s not implemented.', $this->protocolVersion )); } }
本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn
相关文章
![在 Joomla 中连接第三方 PHP 库](https://img.php.cn/upload/article/001/246/273/173532331065396.jpg)
28 Dec 2024
PHP 库很方便,因为可以从应用程序中的任何位置访问它们:从插件、组件模型、模块等。如果有人已经解决了类似的问题并将其设计为库(甚至更新了它),那就有意义了
![重点介绍PHP数据库查询语句](https://img.php.cn/upload/article/202304/06/2023040609214690131.jpg)
06 Apr 2023
PHP作为一种流行的服务器端脚本语言,可以汇集许多不同的数据类型和数据库。尤其是在web应用程序的开发中,它经常需要访问数据库来检索和操作数据。本文将重点介绍PHP数据库查询语句。一、什么是数据库查询语句在对数据库进行操作的过程中,我们常常需要从数据库中获取数据。这时,我们需要使用查询语句。数据库查询(SQL Query)是从数据库中检索数据的指令集。SQL是Structure
![数据库php汉字乱码](https://img.php.cn/upload/article/000/000/020/5dad1f38791a0192.jpg)
21 Oct 2019
数据库php汉字乱码是因为UTF-8编码设置不正确,其解决办法是在创建数据库时执行语句“CREATE DATABASE `dbname` DEFAULT CHARACTER SETutf8 COLLATE utf8_general_ci”。
![聊聊PHP网站数据库安装步骤](https://img.php.cn/upload/article/202304/04/2023040410304621561.jpg)
04 Apr 2023
PHP是广泛应用的动态网页开发语言,为了使网站数据能够被持久地保存和管理,必须使用数据库。本文将讲述PHP网站数据库安装步骤,希望对需要搭建PHP网站的开发人员有所帮助。一、选择数据库类型安装数据库之前,首先要选择数据库类型。目前常用的关系型数据库管理系统有MySQL、Oracle和SQL Server等,而非关系型数据库管理系统如MongoDB和Redis也在高速发展。大多数
![](/static/imghw/down_right.png)
![](/static/imghw/taglogo.png)
Hot Tools
![](/static/imghw/taglogo.png)