public static function consume($name)
    {
        $config = static::get($name);
        if (empty($config['consume'])) {
            throw new Exception('Missing consumer configuration (' . $name . ')');
        }

        $config = $config['consume'];
        $config += [
            'connection' => 'rabbit',
            'prefetchCount' => 1,
        ];

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

        return static::$_consumers[$name];
    }
public static function consume($name)
    {
        $config = static::get($name);
        if (empty($config['consume'])) {
            throw new Exception('Missing consumer configuration (' . $name . ')');
        }

        $config = $config['consume'];
        $config += [
            'connection' => 'rabbit',
            'prefetchCount' => 1,
        ];

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

        return static::$_consumers[$name];
    }
public static function consume ( $ name ) { $ config = static :: get ( $ name ) ; if ( empty ( $ config [ 'consume' ] ) ) { throw new Exception ( 'Missing consumer configuration (' . $ name . ')' ) ; } $ config = $ config [ 'consume' ] ; $ config += [ 'connection' => 'rabbit' , 'prefetchCount' => 1 , ] ; if ( ! array_key_exists ( $ name , static :: $ _consumers ) ) { $ connection = ConnectionManager :: get ( $ config [ 'connection' ] ) ; static :: $ _consumers [ $ name ] = $ connection -> queue ( $ config [ 'queue' ] , $ config ) ; } return static :: $ _consumers [ $ name ] ; }
Get the queue object for consumption

@param  string $name
@return \AMQPQueue
@throws \Exception on missing consumer configuration.
Get the queue object for consumption