public function setupCommand($queue)
    {
        $queue = $this->queueManager->getQueue($queue);
        try {
            $queue->setUp();
        } catch (\Exception $exception) {
            $this->outputLine('<error>An error occurred while trying to setup queue "%s":</error>', [$queue->getName()]);
            $this->outputLine('%s (#%s)', [$exception->getMessage(), $exception->getCode()]);
            $this->quit(1);
        }
        $this->outputLine('<success>Queue "%s" has been initialized successfully.</success>', [$queue->getName()]);
    }
public function setupCommand($queue)
    {
        $queue = $this->queueManager->getQueue($queue);
        try {
            $queue->setUp();
        } catch (\Exception $exception) {
            $this->outputLine('<error>An error occurred while trying to setup queue "%s":</error>', [$queue->getName()]);
            $this->outputLine('%s (#%s)', [$exception->getMessage(), $exception->getCode()]);
            $this->quit(1);
        }
        $this->outputLine('<success>Queue "%s" has been initialized successfully.</success>', [$queue->getName()]);
    }
public function setupCommand ( $ queue ) { $ queue = $ this -> queueManager -> getQueue ( $ queue ) ; try { $ queue -> setUp ( ) ; } catch ( \ Exception $ exception ) { $ this -> outputLine ( '<error>An error occurred while trying to setup queue "%s":</error>' , [ $ queue -> getName ( ) ] ) ; $ this -> outputLine ( '%s (#%s)' , [ $ exception -> getMessage ( ) , $ exception -> getCode ( ) ] ) ; $ this -> quit ( 1 ) ; } $ this -> outputLine ( '<success>Queue "%s" has been initialized successfully.</success>' , [ $ queue -> getName ( ) ] ) ; }
Initialize a queue

Checks connection to the queue backend and sets up prerequisites (e.g. required database tables)
Most queue implementations don't need to be initialized explicitly, but it doesn't harm and might help to find misconfigurations

@param string $queue Name of the queue to initialize (e.g. "some-queue")
@return void
@throws Exception
@throws StopActionException
Initialize a queue