# app/config/config.ymlheri_job_queue:
enabled: truemax_messages: 1# set a process_timeout (in seconds) if you want your commands to be killed# when their execution time is too long (default: null)process_timeout: 60queues: [ queue1 ]

Note: The queue is automatically created, but you can also use the command-line interface in this way:

app/console jobqueue:create queue1

Listener Commands

Run the Listener

To run new messages pushed into the queue, execute this command:

app/console jobqueue:listen

Specify a specific Queue

You may specify which queue connection the listener should utilize (skipping configuration):

app/console jobqueue:listen queue1

Specify the Sleep Duration

You may also specify the number of seconds to wait before polling for new jobs:

app/console jobqueue:listen --sleep=5

Process the first Job on the Queue

To process only the first job on the queue, you may use the jobqueue:work command:

app/console jobqueue:work

Show Jobs

To see the pending jobs, run the command below:

app/console jobqueue:show [queue-name]

Failed Jobs

If a job failed, the exception is logged in the database, and the command is call again after the setted timeout (default 90 seconds):

To delete all of your failed jobs, you may use the jobqueue:flush command:

app/console jobqueue:flush [queue-name]

Jobs Priority

Jobs are executed in the order in which they are scheduled (assuming they are in the same queue). You may also prioritize a call:

$queue->highPriority()->push(['command'=>'cache:clear', ]);

Jobs Monitoring

If you use the Doctrine Adapter, you may use Sonata Admin to monitor your jobs: