It is not documented right here, but amqp.timeout (integer) INI setting exists, check AMQPConnection::setTimeout for more.
Also you can pass it as a 'timeout' key in credentials array in AMQPConnection::__construct
Actually, it works as a timeout to wait for a new messages in AMQPQueue::consume method before die with
Fatal error: Uncaught exception 'AMQPConnectionException' with message 'Resource temporarily unavailable' in /path/to/test/file.php:12
Configurația la rulare
Comportamentul acestor funcții este afectat de parametrii stabiliți în php.ini.
| Denumirea | Valoarea implicită | Poate fi modificată | Jurnalul modificărilor |
|---|---|---|---|
| amqp.host | localhost | PHP_INI_ALL | |
| amqp.vhost | / | PHP_INI_ALL | |
| amqp.port | 5672 | PHP_INI_ALL | |
| amqp.login | guest | PHP_INI_ALL | |
| amqp.password | guest | PHP_INI_ALL | |
| amqp.auto_ack | 0 | PHP_INI_ALL | |
| amqp.min_messages | 0 | PHP_INI_ALL | |
| amqp.max_messages | 1 | PHP_INI_ALL | |
| amqp.prefetch_count | 3 | PHP_INI_ALL |
Iată o explicație pe scurt a directivelor de configurare.
-
amqp.hoststring -
The host to which to connect.
-
amqp.vhoststring -
The virtual host on the broker to which to connect.
-
amqp.portinteger -
The port on which to connect.
-
amqp.loginstring -
The login to use while connecting to the broker.
-
amqp.passwordstring -
The password to use while connecting to the broker.
-
amqp.auto_ackinteger -
Whether calls to AMQPQueue::get() and AMQPQueue::consume() should require that the client explicitly acknowledge messages. Setting this value to 1 will pass in the
AMQP_AUTOACKflag to the above method calls if the flags field is omitted. -
amqp.min_messagesinteger -
The minimum number of messages to require during a call to AMQPQueue::consume().
-
amqp.max_messagesinteger -
The maximum number of messages to require during a call to AMQPQueue::consume().
-
amqp.prefetch_countinteger -
The number of messages to prefect from the server during a call to AMQPQueue::get() or AMQPQueue::consume() during which the
AMQP_AUTOACKflag is not set.
