IronMq + Laravel4:如何使其工作 [英] IronMq + Laravel4: How make it working

查看:108
本文介绍了IronMq + Laravel4:如何使其工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是IronMQ收到了我的队列但没有触发. 就像我在这个问题上问的那样: > https://stackoverflow.com/questions/19200285/laravel4-ironmq-queue-are-未执行

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

但是我在Iron仪表盘中看到,我订阅了一个新域之后,便没有将其添加到任何列表中. IronMQ可能应该显示已订阅域的列表,不是吗? 这可能是我的队列未触发的原因. 我该如何解决这个问题? 谢谢!

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!

推荐答案

我不确定您是否已完成预订队列所需的所有步骤,所以让我们看一下它们:

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:

在文件app/config/queue.php中将队列配置为默认为Iron,设置为:

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

'default' => 'iron',

并配置您的连接:

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

为您的队列/接收端点创建一条路由,并从Queue :: marshal方法返回响应:

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! [] []

它是由我们添加到您的元帅路由器中的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.

现在您可以在IronMQ上为特定队列注册URL:

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

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

一个例子是:

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

这是您之前在测试中使用的URL.

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

此命令必须向您显示:

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.

然后,您可以转到IronMQ的队列页面,并检查队列是否已订阅:

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.

如果一切均已设置,请再次发送您的电子邮件(通过队列),然后检查日志以查看是否为"log.INFO:封送!".出现在那里.这次必须显示但被IronMQ调用.

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.

这篇关于IronMq + Laravel4:如何使其工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆