laravellaravel-4queueironmq

IronMq + Laravel4: How make it working


I have a problem concerning the fact that my queues are received by IronMQ but not fire off. Like i ask in this question: https://stackoverflow.com/questions/19200285/laravel4-ironmq-queue-are-not-executed

But i see that inside my Iron dashboard, after i subscribe a new domain, then it is not added in any list. Probably IronMQ should display a list of Domains subscribed, isn't it? And this is probably the reason why my queues are not fire off. How can i fix the issue? Thanks!


Solution

  • I'm not sure you have done all steps you need to do to have your queues subscribed, so let's take a look at them:

    Configure your queue to be default as Iron in the file app/config/queue.php, set:

    'default' => 'iron',
    

    And configure your connection:

    'iron' => array(
        'driver'  => 'iron',
        'project' => 'YOUR PROJECT NUMBER',
        'token'   => 'YOUR TOKEN',
        'queue'   => 'YOUR QEUE NAME',
    ),
    

    Create a route for your queue/receive end-point and return the response from the Queue::marshal method:

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

    And test it! Outside your server acess it using a curl or something like that:

    curl --data "param1=whatever" http://<your.domain.com>/queue
    

    edit: You can copy this whole line and just replate with your url.

    Open your log file in the folder:

    app/storage/logs/
    

    You should see something like this there:

    [2013-10-10 10:26:09] log.INFO: marshal! [] []
    

    It was generated by Log::info('marshal!'); we added to your marshal router. But you may also see an error saying 'Invalid data.', igore it, we were not doing a real test, we just needed to know if your marshal route was working.

    Now you can register your url for a particular queue on IronMQ:

    php artisan queue:subscribe <queue name on IronMQ> <url>
    

    An example would be:

    php artisan queue:subscribe johnnyfittizio http://<your.domain.com>/queue
    

    This is the same url you used in the test before.

    This command MUST show you:

    Queue subscriber added: http://<your.domain.com>/queue
    

    If it doesn't, you have to check your configuration again, you might have done something wrong there.

    Then you can go to your IronMQ's queue page and check if your queue is subscribed:

    1. Go to https://hud.iron.io/dashboard
    
    2. On your projects, click in tue MQ button of your project
    
    3. Select the "Queues" tab
    
    4. Click on your queue name, this must be the same you subscribed to using the command "artisan queue:subscribe"
    
    5.In the "PUSH INFORMATION" box, check if your queue push type is set to "multicast".
    
    6.Check if your queue is subscribed in the "SUBSCRIBERS" box, it's in the page bottom right area.
    

    If everything is set, fire your e-mail (via queue) again and check the log to see if "log.INFO: marshal!" shows up there. This time it must show but being called by IronMQ.

    If it does and you don`t get an e-mail, the queue is working and you have to check your e-mail configuration.