PHP code example of forumhouseteam / laravel-amqp

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

    

forumhouseteam / laravel-amqp example snippets



'default' => 'amqp',

'connections' => array(
    'amqp' => array(
        'driver' => 'amqp',
        'host' => 'localhost',
        'port' => '5672',
        'user' => 'guest',
        'password' => 'guest',
        'vhost' => '/',
        'queue' => null,
        'queue_flags' => ['durable' => true, 'routing_key' => null], //Durable queue (survives server crash)
        'declare_queues' => true, //If we need to declare queues each time before sending a message. If not, you will have to declare them manually elsewhere
        'message_properties' => ['delivery_mode' => 2], //Persistent messages (survives server crash)
        'channel_id' => null,
        'exchange_name' => null,
        'exchange_type' => null,
        'exchange_flags' => null,
        'keepalive' > false,
        'heartbeat' => 0,
        'retry_after' => 0,
        ),
),

class Handler extends ExceptionHandler
{

class Handler extends ExceptionHandler
{
    use AMQPFailureDetector;

public function report(Exception $exception)
{
    parent::report($exception);
}

public function report(Exception $exception)
{
    $this->catchAMQPConnectionFailure($exception);
    parent::report($exception);
}
config/queue.php
config/app.php