IronMq+;Laravel4:如何让它工作

IronMq+;Laravel4:如何让它工作,laravel,queue,laravel-4,iron,Laravel,Queue,Laravel 4,Iron,我有一个问题,就是我的队列是由IronMQ接收的,而不是fire off。 就像我在这个问题上问的: 但我看到在我的Iron仪表板中,在我订阅了一个新域之后,它就不会被添加到任何列表中。 也许IronMQ应该显示订阅的域列表,不是吗? 这可能就是为什么我的队伍没有被点燃的原因。 我如何解决这个问题? 谢谢 > P>我不确定你已经完成了你需要排队的所有步骤,所以让我们来看看它们: 在文件app/config/queue.php中,将队列配置为默认的Iron,设置: 'default' =>

我有一个问题,就是我的队列是由IronMQ接收的,而不是fire off。 就像我在这个问题上问的:

但我看到在我的Iron仪表板中,在我订阅了一个新域之后,它就不会被添加到任何列表中。 也许IronMQ应该显示订阅的域列表,不是吗? 这可能就是为什么我的队伍没有被点燃的原因。 我如何解决这个问题?
谢谢

> P>我不确定你已经完成了你需要排队的所有步骤,所以让我们来看看它们:

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

'default' => 'iron',
并配置您的连接:

'iron' => array(
    'driver'  => 'iron',
    'project' => 'YOUR PROJECT NUMBER',
    'token'   => 'YOUR TOKEN',
    'queue'   => 'YOUR QEUE NAME',
),
为队列/接收端点创建路由,并从queue::marshal方法返回响应:

Route::post('queue', function()
{

    Log::info('marshal!');

    return Queue::marshal();

});
并测试它!在服务器外部,使用curl或类似的方法访问它:

curl --data "param1=whatever" http://<your.domain.com>/queue
您应该在那里看到类似的内容:

[2013-10-10 10:26:09] log.INFO: marshal! [] []
它是由
Log::info('marshal!')生成的我们已添加到您的封送路由器。但是你也可能会看到一个错误,上面写着“无效数据”。我们没有做真正的测试,我们只是想知道你的封送路由是否正常工作

现在,您可以在IronMQ上注册特定队列的url:

php artisan queue:subscribe <queue name on IronMQ> <url>
如果一切都已设置好,请再次发送电子邮件(通过队列)并检查日志,查看是否显示“log.INFO:marshal!”。这次它必须显示,但被IronMQ调用


如果是,但您没有收到电子邮件,那么队列正在工作,您必须检查您的电子邮件配置。

感谢Antonio Ribeiro的帮助! 为了让一切正常运转,需要做一些小的改变: 在IronMQ中,我必须更改队列的类型,从拉式队列更改为多播队列 现在我终于可以看到我订阅的URL列表了。 如果我运行这个测试应用程序,它工作得很顺利,队列也能正常启动

如果您想知道原因,这是Iron.io support的答案:

Yes, you are able to add URLs to your push queues, both multicast and unicast.
Multicast sends message through POST to all subscribers URLs at the same time 
and retries on failed endpoints. 
But unicast sends to subscribers by turn while one of them returns 
right response and retries if all endpoints in subscribers list failed.
正如我在所附图片中看到的,您的队列具有“拉”类型。意思是排队 不会触发HTTP(S)POST到端点,您需要获取消息 通过API(或客户端库中的“get”方法/函数)。翻身 队列为“推送”类型您可以:1)更新队列信息并至少添加 单推队列相关参数(例如,“订阅者”:[ {“url”:proto://domain/path"} ] ). 有关详细信息,请参阅 2) 通过HUD, 正在更改队列的类型

编辑:

好的,最后澄清一下:也可以设置单播。Iron.io支持解释了两者之间的差异:

Yes, you are able to add URLs to your push queues, both multicast and unicast.
Multicast sends message through POST to all subscribers URLs at the same time 
and retries on failed endpoints. 
But unicast sends to subscribers by turn while one of them returns 
right response and retries if all endpoints in subscribers list failed.

您使用的是本地主机还是live server?谢谢您的回复。但我仍然处于相同的情况:我在IronMQ中接收队列,但没有被激发。照你说的做,我得到了3个错误:在日志文件上有这样一个错误:[2013-10-10 14:16:44]log.error:exception'Symfony\Component\HttpKernel\exception\MethodNotAllowedHttpException'。从PowerShell添加队列时出现以下错误:基于Iron.io的队列必须是默认队列。无论如何,正如您所说,我从IronMQ仪表板手动添加了。手动添加后,任何列表中都不会显示任何内容。在任何情况下,如果我打开MYAPP/queue,每次您在IronMQ中手动订阅URL时,都会在IronMQ中接收到队列,然后它会显示在列表中,对吗?我只是编辑了答案的顶部以包含配置详细信息。错误“Iron.io-based queue必须是默认值。”必须是该错误。MethodNotAllowedHttpException是因为您试图使用GET请求访问POST方法。您是否使用CURL--data访问它?queue.php已经正确配置。为了访问该站点,我使用了curl。我不知道哪些参数作为数据传递。我为curl编写的那行代码就是我在这里用来测试的。只需将url替换为您的url即可。您不需要通过真正的数据,这不是真正的测试,但必须是POST方法。正如我在回答中告诉您的那样:
但您也可能会看到一个错误,上面写着“无效数据”。我注意到,我们没有进行真正的测试,我们只需要知道您的封送处理路由是否有效。`编辑我的问题,将您的解决方案(更改队列类型)添加到同一问题中的步骤中。
Queue subscriber added: http://<your.domain.com>/queue
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.
Yes, you are able to add URLs to your push queues, both multicast and unicast.
Multicast sends message through POST to all subscribers URLs at the same time 
and retries on failed endpoints. 
But unicast sends to subscribers by turn while one of them returns 
right response and retries if all endpoints in subscribers list failed.