Download the PHP package heismehrab/php-rabbitmq-x without Composer
On this page you can find all versions of the php package heismehrab/php-rabbitmq-x. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-rabbitmq-x
php-rabbitMQ-x package
This package basically designed to communicate with your Rabbitmq instance to consume/produce messages.
You must be familiar with basic titles of Rabbitmq to understand how this packages works and how it behaves with Rabbitmq processes.
We suggest that you visit the official website of Rabbitmq if you are not familiar with the whole Rabbitmq cycle, or you can visit example oriented samples of Rabbitmq if you already familiar with it.
Installation.
Before anything, developer has to know that package uses php >= 7.0
and
ONLY features of Rabbitmq which supported by the package explains in below:
titles | Features/Types | version |
---|---|---|
Queues | DLX , exchange-bindings |
0.9.0 , 1.0.0 |
Exchanges | Fanout , direct , routing-keys |
0.9.0 , 1.0.0 |
QOS (Fair dispatching) | prefetch-size , prefetch-count |
0.9.0 , 1.0.0 |
install via composer:
After installing the package, we need to have a configuration file which the both producer and consumer workers needs it to start the process.
This configuration file keeps the details of all Rabbitmq authentication
, Queues
, Exchanges
, Dead letter exchanges
, exchange and queue bindings
and QOS tuning settings
;
You can see and use the structure of original config file in below:
For more examples of the configuration file, you can check the original file which placed in package root directory.
How the package works?
When we get an instance of a Producer/Consumer and inject the configuration file into that, the service will start validate the file and then declare the queues, exchanges, etc... which explained in above table; finally we have a configured Rabbitmq instance which is ready to handle messages/tasks.
Examples.
some samples that describe how a Producer and Consumer works:
Producer:
Consumer:
To be sure that Producer service closes the connections to Rabbitmq after sending messages/tasks,
you can call the closeConnections()
method, this method is available in both Producer and Consumer instances;
note the Consumer call this method by its own, so you don't need to do that in manual for Consumer services.
you can also take a look at here directory of package to see more example oriented samples.