Download the PHP package graphaware/php-simplemq without Composer
On this page you can find all versions of the php package graphaware/php-simplemq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-simplemq
GraphAware's PHP Simple Message Queue for RabbitMQ
RabbitMQ's Rapid Application Development.
This library makes possible to create channels, queues, bindings, producers, consumers, .. on the fly by only providing a simple YAML configuration file.
Usage
Require the library dependency :
Define the connections, exchanges, producers and consumers, eg:
Bootstrap the library by providing your configuration file location :
Based on the example configuration, producers named logs
and errors
as well as consumers named logs-printer
and
error-logs-recorder
are available through the library.
To retrieve and start consuming queues, you can get the consumer with the following method :
Getting a single message :
Getting more than one message :
Sometimes, there can be a latency between a message is sent and this message to be seen by the producers (for eg in CI suites).
You can define a maxAttempts to reach the batchSize before stopping reading queues :
And to start sending messages to exchanges, it is pretty much the same :
The producer and consumers knows exactly, based on the configuration, which routing key to use for direct and topic exchanges and also which binding keys to use for binding queues to exchanges.
License: MIT
Author: Christophe Willemsen
All versions of php-simplemq with dependencies
symfony/yaml Version ^2.7
symfony/finder Version ^2.7
symfony/filesystem Version ^2.7