Download the PHP package sunspikes/carrot without Composer
On this page you can find all versions of the php package sunspikes/carrot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package carrot
Carrot
A simple abstraction for RabbitMQ.
Carrot aims to make it easy to get started with RabbitMQ and PHP, at the same time maintaining the flexibility to implement all the supported messaging patterns.
Requirements
You must have a rabbitmq server running to use this package. For more on this refer RabbitMQ documentation.
Installation
With Composer
Usage
To configure a RabbitMQ connection
To publish message to RabbitMQ,
To Consume messages from RabbitMQ
More on usage
You don't have to use static methods to build and use producers and consumers, also the library makes it easy to switch between different exchange types.
For example, you can also create a direct exchange & produce messages to it like,
Also the consumer can be created and listened to a direct exchange for messages like,
By default carrot producer will automatically serialize the message and consumer will deserialize the message acknowledge the incoming messages, you could disable this delegation by setting the configuration parameter delegate
to false
Example
You can run the examples from the /example folder
First run the consumer, it will create the exchange and queue on the rabbitmq server
As soon as you run the producer, the consumer will print the message text sent by the producer
Testing
Run phpunit
Author
Krishnaprasad MG [@sunspikes]
Contributing
Please feel free to send pull requests.
License
This is an open-sourced software licensed under the MIT license.