IronMq + Laravel4: Job submitted but Queue not working

170 views Asked by At

I am trying to add a new user to a group and send an activation email. It was working earlier when I implemented it without queues.

Here's my (relevant) code in app/routes.php:

Queue::getIron()->ssl_verifypeer = false;

Route::post('queue/demo', function(){
    Log::info('marshal!');
    return Queue::marshal();
});

class FinishUserRegistration{
public function fire($job, $data){
    $user_id = $data['user_id'];
    $usergroup = Sentry::getGroupProvider()->findById(2);
    $newuser = Sentry::findUserById($user_id);
    $newuser->addGroup($usergroup);
    $emailData = array(
        'user_name' => $newuser->first_name . ' ' . $newuser->last_name,
        'activation_code' => $newuser->getActivationCode(),
        'user_id' => $newuser->id,
        'repeat' => false,
    );
    Mail::send('emails.activation', $emailData, function ($message) use($user_id){
        $newuser = Sentry::findUserById($user_id);
        $message->to($newuser->email, $newuser->first_name . ' ' . $newuser->last_name)->subject('Welcome to The Site!');
    });

    $job->delete();
}
}

In UsersControlller.php, I have:

public function postModalRegister(){
    $user = Sentry::createUser($input);
    /*
    $user->addGroup($usergroup);
    $this->activationMail($user->id, false);
    */

    Queue::push('FinishUserRegistration', ['user_id'=>$user->id]);

    return \Response::json(['success' => true], 200);
}

I have followed the instructions at IronMq + Laravel4: How make it working. When I register a new user, I receive success and I can see message count increase in IronMQ dashboard. But laravel.log doesn't show "marshal!", neither does it when I do curl --data "param1=whatever" http://livesite.com/queue/demo

Also, I have

Route::when('*', 'csrf', array('post', 'put', 'delete', 'patch'));

in my routes file, so the queue/demo route has a csrf before filter too.

0

There are 0 answers