PHP code example of lefuturiste / rabbitmq-publisher

1. Go to this page and download the library: Download lefuturiste/rabbitmq-publisher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lefuturiste / rabbitmq-publisher example snippets


$rabbitmqClient = new Lefuturiste\RabbitMQPublisher\Client('example.com', '424242', 'user', 'password', 'virtual_host');
//you can use array as message body
//body is json encoded
$rabbitmqClient->publish('Hello world', 'my_event');