Download the PHP package mjohann/simple-rabbitmq without Composer
On this page you can find all versions of the php package mjohann/simple-rabbitmq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mjohann/simple-rabbitmq
More information about mjohann/simple-rabbitmq
Files in mjohann/simple-rabbitmq
Package simple-rabbitmq
Short Description Simple RabbitMQ is a PHP class that offers a clean and reusable abstraction for working with RabbitMQ. It simplifies the process of connecting to message queues and performing common operations like publishing messages, consuming queues, acknowledging deliveries, and managing exchanges and bindings β all without having to deal with the complexity of the underlying configuration.
License MIT
Informations about the package simple-rabbitmq
Simple RabbitMQ
Simple RabbitMQ is a PHP class that offers a clean and reusable abstraction for working with RabbitMQ. It simplifies the process of connecting to message queues and performing common operations like publishing messages, consuming queues, acknowledging deliveries, and managing exchanges and bindings β all without having to deal with the complexity of the underlying configuration.
π¦ Installation
You can install the library via Packagist/Composer:
βοΈ Requirements
- PHP 8.0 or higher
π Features
- Simple RabbitMQ uses
enqueue/amqp-libas a dependency - Supported:
- __construct β Configures the connection parameters (e.g., host, port, credentials).
- open β Opens a connection to the RabbitMQ server.
- close β Closes the connection.
- exchange($name) β Declares an exchange.
- pubExchange($message) β Publishes a message to the exchange.
- queue($name) β Declares a queue.
- queueBind() β Binds a queue to an exchange.
- pubQueue($message) β Publishes a message to the queue.
- sub($callback) β Subscribes a callback function to consume messages from the queue.
- waitCallbacks($milliseconds) β Waits for messages and dispatches them to the subscribed callbacks for a given duration.
- readMessage() β (Commented out, but exists) Likely reads a single message from the queue.
- acknowledge($message) β Acknowledges receipt of a message (seen in the consumer callback via $consumer->acknowledge()).
π§ͺ Usage Example
Publisher
Subscriber
For more examples, see the example/ file in the repository.
π Project Structure
π License
This project is licensed under the MIT License. See the LICENSE file for more information.
π¨βπ» Author
Developed by Matheus Johann AraΓΊjo β Pernambuco, Brazil.