我正在使用 Iron.mq。我已使用此代码将消息推送到 iron.io 队列中
public function reminder(){
$section_url = Input::get('section_url');
$selectdate = Input::get('selectdate');
$email = Auth::user()->email;
$MailQueue = new MailQueue;
$data = [];
$data['system_name'] = $section_url;
$data['date_selected'] = $selectdate;
$job_id = Queue::push('UserController@fire',$data);
$MailQueue->job_id = $job_id;
$MailQueue->user_id = Auth::user()->id;
$MailQueue->system_name = $section_url;
$MailQueue->date_selected = $selectdate;
$MailQueue->save();
return 1 ;
}
现在我想处理来自熨斗的这些消息并响应我的网页,我在熨斗中订阅了网址“ http://example.com/hmtc/queue/recieve ”。
Route::post('queue/receive', function(){
return Queue::marshal();
});
这是我在铁上订阅的路线。
我根据 laravel 文档创建了 fire 函数。
public function fire($job, $data){
$job_id = $job->getJobId(); // Get job id
$Testjob = new Testjob;
$Testjob->name = $job_id;
$Testjob->save();
return 'this is testing';
}
现在,我不知道这个过程。由于数据库表中没有条目,该过程将如何执行。请帮助我如何处理这些放入铁队列中的消息。我没有得到回应。当我推送消息然后保存到数据库中时,我只会得到 rendom 密钥。
我需要处理这些消息并且只想得到响应。
我在等你的回复。
谢谢, 阿努普