This module interacts with message broker software that implements the Advanced Message Queuing Protocol (AMQP) standard. For example, RabbitMQ (tested). Use it to cleanup the queue between tests.
Please review the code of non-stable modules and provide patches if you have issues.
modules:
enabled:
- AMQP:
host: 'localhost'
port: '5672'
username: 'guest'
password: 'guest'
vhost: '/'
queues: [queue1, queue2]
@since 1.1.2 @author tiger.seo@gmail.com @author davert
Takes last message from queue.
$message = $I->grabMessageFromQueue('queue.emails');
param
$queuereturn
AMQPMessagePurge all queues defined in config.
<?php
$I->purgeAllQueues();
?>
Purge a specific queue defined in config.
<?php
$I->purgeQueue('queue.emails');
?>
Sends message to exchange by sending exchange name, message and (optionally) a routing key
<?php
$I->pushToExchange('exchange.emails', 'thanks');
$I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'));
$I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'), 'severity');
?>
param
$exchangeparam
$message string|AMQPMessageparam
$routing_keySends message to queue
<?php
$I->pushToQueue('queue.jobs', 'create user');
$I->pushToQueue('queue.jobs', new AMQPMessage('create'));
?>
param
$queueparam
$message string|AMQPMessageChecks if message containing text received.
This method drops message from queue This method will wait for message. If none is sent the script will stuck.
<?php
$I->pushToQueue('queue.emails', 'Hello, davert');
$I->seeMessageInQueueContainsText('queue.emails','davert');
?>
param
$queueparam
$text