Download the PHP package cmdrsharp/amqp-route-messenger without Composer
On this page you can find all versions of the php package cmdrsharp/amqp-route-messenger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmdrsharp/amqp-route-messenger
More information about cmdrsharp/amqp-route-messenger
Files in cmdrsharp/amqp-route-messenger
Package amqp-route-messenger
Short Description A client for publishing and listening for routed exchange messages.
License MIT
Informations about the package amqp-route-messenger
About
A client for publishing and listening for routed exchange messages.
Current Requirements
- PHP 7.2 or newer
- Laravel 5.8 or newer
Installation
Via composer
After installation, publish the configuration file.
Which will create a amqproutemessenger.php
file in your Laravel config directory. This will contain bindings for the RabbitMQ Queue Details.
It is recommended to simply define these in your .env
file. The config file will automatically read from these values.
For SSL Connections, just specify (in your .env file) the path to the CA Certificate, and whether to use peer verification. If these are specified, an AMQPSSLConnection
will be established.
Usage
Inject the contract into the class where you need the client:
Alternatively, if you don't wish to autoload, you may also require it directly.
Example: Publish a message with a correlation ID
All we are doing here is declaring which exchange to publish the message to, and then publishing it with a specified correlation ID.
declareExchange
accepts an optional second parameter which makes it passive
Example: Read a message with a correlation ID
It is recommended that the consumer is set up prior to any messages being published. This is to ensure that the queue bindings have been created, so that published messages are routed correctly.
Example: Reading and Publishing put together
Versioning
This package follows Explicit Versioning.
Authors
License
The MIT License (MIT)