In the controller I have created following things according to the document
protected $queue;
public function __construct(QueueInterface $queue) {
$this->queue = $queue;
}
public function fooAction()
{
$job = new EmailJob;
$job->setContent(array(
'to' => 'john@doe.com',
'subject' => 'Just hi',
'message' => 'Hi, I want to say hi!'
));
$this->queue->push($job, ['delay' => 60]);
}
In module.config.php I have define a route like this
'email' => array (
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array (
'route' => '/email',
'defaults' => array (
'controller' => 'Application\Controller\Index',
'action' => 'foo'
)
),
),
When I go to the url /email it is showing 500 error because the constructor is expecting one argument and I am not passing any argument. When I try to run following command
php index.php queue beanstalkd default
The result I am getting is
Zend Framework 2.3.3 application
Usage:
Reason for failure: Invalid arguments or no arguments provided
In the controller I have created following things according to the document
When I go to the url /email it is showing 500 error because the constructor is expecting one argument and I am not passing any argument. When I try to run following command php index.php queue beanstalkd default The result I am getting is