iron.io queue implementaion in laravel 4

51 views Asked by At

I am using the Iron.mq. I have pushed the messages in the iron.io queue with this code

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 ;
}

Now I want to process these messages from the iron and get to response into my webpage I have subscribed the url "http://example.com/hmtc/queue/recieve" in the iron.

Route::post('queue/receive', function(){
    return Queue::marshal();
});

this the route which I have subscribed in the iron.

I have created the fire function according to the laravel documentation.

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';
}

Now, I don't have idea about the process. How the process will be executed because there has no entries in the database table. Please help me that how to process these msgs which are placed into the iron queue. I am not getting the response. I am only getting the rendom key when I am pushing the msgs and then saving into the DB.

I need to process these messages and want to get the response only.

I am waiting your responses.

Thanks, Anup

0

There are 0 answers