public static function publish($name, $data, array $options = [])
    {
        $config = static::get($name);
        if (empty($config['publish'])) {
            throw new Exception('Missing publisher configuration (' . $name . ')');
        }

        $config = $config['publish'];
        $config += $options;
        $config += [
            'connection' => 'rabbit',
            'className' => 'RabbitMQ.RabbitQueue'
        ];

        if (!array_key_exists($name, static::$_publishers)) {
            static::$_publishers[$name] = ConnectionManager::get($config['connection']);
        }

        return static::$_publishers[$name]->send($config['exchange'], $config['routing'], $data, $config);
    }
public static function publish($name, $data, array $options = [])
    {
        $config = static::get($name);
        if (empty($config['publish'])) {
            throw new Exception('Missing publisher configuration (' . $name . ')');
        }

        $config = $config['publish'];
        $config += $options;
        $config += [
            'connection' => 'rabbit',
            'className' => 'RabbitMQ.RabbitQueue'
        ];

        if (!array_key_exists($name, static::$_publishers)) {
            static::$_publishers[$name] = ConnectionManager::get($config['connection']);
        }

        return static::$_publishers[$name]->send($config['exchange'], $config['routing'], $data, $config);
    }
public static function publish ( $ name , $ data , array $ options = [ ] ) { $ config = static :: get ( $ name ) ; if ( empty ( $ config [ 'publish' ] ) ) { throw new Exception ( 'Missing publisher configuration (' . $ name . ')' ) ; } $ config = $ config [ 'publish' ] ; $ config += $ options ; $ config += [ 'connection' => 'rabbit' , 'className' => 'RabbitMQ.RabbitQueue' ] ; if ( ! array_key_exists ( $ name , static :: $ _publishers ) ) { static :: $ _publishers [ $ name ] = ConnectionManager :: get ( $ config [ 'connection' ] ) ; } return static :: $ _publishers [ $ name ] -> send ( $ config [ 'exchange' ] , $ config [ 'routing' ] , $ data , $ config ) ; }
Publish a message to a RabbitMQ exchange

@param  string $name
@param  mixed  $data
@param  array  $options
@return boolean
Publish a message to a RabbitMQ exchange