lizards-and-pumpkins / lib-queue-backend-amqp
Lizards & Pumpkins AMQP 队列
此软件包的官方仓库似乎已消失,因此软件包已被冻结。
4.0.0
2022-11-28 21:58 UTC
Requires
- php: ^8.1
- lizards-and-pumpkins/config-reader: ^1.0.0
- lizards-and-pumpkins/messaging: ^3.0.0
- php-amqplib/php-amqplib: ~3.2.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-01-18 15:20:53 UTC
README
Lizards & Pumpkins AMQP 队列库
安装步骤
-
添加项目依赖项:
composer require lizards-and-pumpkins/lib-queue-backend-amqp dev-master
-
安装 RabbitMQ:例如
sudo apt-get install rabbitmq-server
-
在环境中配置访问凭证(无论你在哪里设置其他 Lizards & Pumpkins 设置)
# insecure default example access credentials: export LP_AMQP_HOST="localhost" export LP_AMQP_PORT="5672" export LP_AMQP_USERNAME="guest" export LP_AMQP_PASSWORD="guest" export LP_AMQP_VHOST="/"
-
将相同的配置设置添加到您的 www NGINX 或 Apache 配置中
# insecure default example access credentials: fastcgi_param LP_AMQP_HOST "localhost"; fastcgi_param LP_AMQP_PORT "5672"; fastcgi_param LP_AMQP_USERNAME "guest"; fastcgi_param LP_AMQP_PASSWORD "guest"; fastcgi_param LP_AMQP_VHOST "/";
-
将
AmqpFactory
与MasterFactory
实例注册,例如使用工厂注册回调public function factoryRegistrationCallback(MasterFactory $masterFactory) { $masterFactory->register(new \LizardsAndPumpkins\Messaging\Queue\Amqp\AmqpFactory()); }
请注意,为了在生产环境中运行 RabbitMQ,必须采取适当的 安全措施,但这超出了本文档的范围。
有关更多信息,请参阅 RabbitMQ 的 访问控制 和 TLS 文档。