PHP code example of wisembly / amqp-bundle

1. Go to this page and download the library: Download wisembly/amqp-bundle 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/ */

    

wisembly / amqp-bundle example snippets


use Wisembly\AmqpBundle\Message;
use Wisembly\AmqpBundle\Publisher;

$message = new Message(
    'symfony:command:to:run',
    [
        'list',
        'of',
        'arguments'
        'and'
        'options'
    ]
]));

// Using swarrot's Swarrot\Broker\Message is also possible if you don't plan on
// consuming the message through the provider consumer

$publisher->publish($message, 'my_gate');
// or $publisher->publish($message, $gate); with `$gate` an instanceof Gate

php app/console wisembly:amqp:consume gate