【发布时间】:2013-03-19 14:20:23
【问题描述】:
我希望有一个 PHP 脚本使用(使用 PECL AMQP 模块)来自 RabbitMQ 队列,然后分叉执行实际工作。
我有代码@https://gist.github.com/giggsey/6666e67bb0e090eeb5f0
但是当我运行它时,我得到:
11296 密钥:USER.12392 ObjectLength:74 在 2013-03-19 分叉 11296
14:16:22 11277 ack() PHP 致命错误:未捕获的异常
'AMQPConnectionException' 在 tmp/forking.php:10 中带有消息'Connection reset by peer'
堆栈跟踪:
0 tmp/forking.php(10): AMQPQueue->consume(Array)
1 tmp/forking.php(102): test->run()
2 {main} 在第 10 行的 tmp/forking.php 中抛出
致命错误:带有消息的未捕获异常“AMQPConnectionException” 第 10 行 tmp/forking.php 中的“对等连接重置”
AMQPConnectionException: Connection reset by peer in tmp/forking.php on line 10
调用栈:
0.0006 665008 1. {main}() tmp/forking.php:0 0.0007 665456 2. test->run() tmp/forking.php:102 0.0359 670504 3. AMQPQueue->consume() tmp/forking.php:10
【问题讨论】:
-
你试过这个没有叉子的东西吗?
-
@mzedeler 是的,没有分叉它可以正常工作。
-
您是从 CLI 运行的?
-
@Bubba 是的。 PHP 5.3 与 Peck AMQP 1.0.9