(PECL amqp >= Unknown)

AMQPQueue::consumeThe consume purpose


public void AMQPQueue::consume ( array $options )


This function is currently not documented; only its argument list is available.



options is a an array of consume options. The keys used in the options array are: min, max, and ack. All other keys will be ignored.

For each missing option, the extension will check the ini settings or use the default value.

Return Values

An array contained a the messages consumed. The number of returned messages will be at least the number given by min in the options array. But not more than the number given by max.


Example #1 AMQPQueue::consume() example


/* Create a connection using all default credentials: */
$connection = new AMQPConnection();

/* create a queue object */
$queue = new AMQPQueue($connection);

//declare the queue

$options = array(
'min' => 1,
'max' => 10,
'ack' => true

//get the messages
$messages $queue->consume($options);

foreach (
$messages as $message) {


Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout